npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gulp-shrt

v1.0.4

Published

Make gulp syntax shorter

Readme

gulp-shrt

Make gulp syntax shrter.

Why?

You might sometimes want to quickly set up your tasks without using any generators.

Considering you want to use gulp-sass on a style.scss file:

var gulp = require("gulp")
var sass = require("gulp-sass")
var del = require("del")

gulp.task("sass", ["clean"], function () {
	return gulp.src("file.scss")
		.pipe(sass())
		.pipe(gulp.dest("."))
})

gulp.task("clean", function () {
	del("*.css")
})

Then make it shrter:

var task = require("gulp-shrt").task
var del = require("del")

task("sass{clean}", "file.scss", "sass", ".")

task("clean", function () {
	del("*.css")
})

Disclaimer: using gulp-shrt will slow down a little your gulp tasks' execution.

Get the module

$ npm install --save gulp-shrt

Don't forget that you need a package.json (initializable using npm init) file at the root of your project so then you can install gulp-shrt.

How to use it?

You can either consult examples (available in /examples) or read the following API.

API

shrt(from, cmds[, to])

Create a gulp stream starting with gulp.src(from), then pipe()'ing each command from cmds and -- if given -- ends with gulp.dest(to).

Parameters

String | Array -- from : pattern(s) matching file(s).
Examples: "*.js", ["lib/**/*.*", "*.css"]

String | Object | Array -- cmds:

  • String: "command" (without brackets) refers to the "gulp-command" module and will call its constructor without arguments.
    Examples: "sass" will execute .pipe(require("gulp-sass")()).
  • Object:
    • not using module method: {moduleName: args || [arg1,arg2,...]}:
      {sass: {outputStyle: "compact"}}
            
      // will execute
            
      .pipe(require("gulp-sass")(
      	{outputStyle: "compact"}
      ))
      {module: [3, {foo: "bar"}]}
            
      // will execute
            
      .pipe(require("gulp-module")(
      	3, 
          {foo: "bar"}
      ))
    • using module method: {pipe: [moduleInstance.method, args]}:
      var sourcemaps = require("gulp-sourcemaps")
            
      // later
            
      {pipe: [sourcemaps.init]} // or {pipe: [sourcemaps.init, []}
            
      // will execute
            
      .pipe(sourcemaps.init())
  • Array: [..., ..., ...] will evaluate each command either as a String or as an Object.

String -- to (optional): destination for stream output (using .pipe(gulp.dest(to))).
Examples: '.', "build/css"

Example

shrt("f.js", "uglify", "build/js")
shrt("*.babel.js", [
	{babel: {presets: ["es2015"]}},
    "uglify"
], "build/js")

shrt.task(name, from, [cmds[, to]])

Call gulp.task() named name using mentionned dependencies, then call shrt(from, cmds, to).

Parameters

String -- name: Task name, eventually followed by task dependencies.
Examples: "hello", "hello{clean}", "hello{clean, check}"

String | Array | Function -- from: pattern(s) matching file(s) or the function to execute (as with a gulp.task("name", function () {}).
If from is a function, cmds and to are unecessary (they will be ignored).
Examples: "*.js", ["lib/**/*.*", "*.css"], function () { ... }

cmds, to: Please, refer to short's cmds, and to arguments.

Example

shrt.task("hello{clean}", "file.scss", "sass", "build")
shrt.task("world", function () { ... })
shrt.task("42", ["t.js", "lib/o.js"], ["babel", "uglify"], ".")

shrt.watch(src, tasks), shrt.watch([ [src, tasks], ... ]

Call gulp.watch() for each watching array using src as glob, and tasks as tasks to call.

Parameters

String | Array -- src: pattern(s) matching file(s).
Examples: "*.js", ["lib/**/*.*", "*.css"]

String | Array -- tasks: task(s) to execute (follows array order).
Examples: "clean", ["clean", "check"]

Example

shrt.watch("*.js", "build")
shrt.watch(["*.scss", "tmp/*.scss"], ["clean", "sass"])

License

MIT © eveningkid