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

@simpleweb/gulp

v2.0.2

Published

Commonly used Gulp tasks to get you off the ground faster

Readme

gulp

Commonly used Gulp tasks to get you off the ground faster

What does it do?

@simpleweb/gulp abstracts some of the most commonly used tasks we use across projects, like compiling Sass and ES6. It's aim is to take away the menial things you have to do each time to get these working.

It does this by giving you a set of tasks, these simply return Gulp streams. There's no magic going on below the surface.

Quick start

  • Styles - Compiles Sass to CSS for you, it'll also apply Autoprefixer and include any Bower dependencies.
  • Sass - Simply compiles Sass to CSS.
  • Scripts - Compiles ES6 to ES5 compliant JavaScript and can include any Bower dependencies.
  • ES6 - Simply compiles ES6 to ES5 compliant JavaScript.

Super quick start ⚡

If you're looking to get off the ground even faster and happy with some default behaviours being set, this is for you.

Just specify the directory of your sources files and your destinations and you'll get access to the following gulp tasks.

  • scripts - Compiles ES6 to ES5 and loads in Bower dependencies.
  • styles - Compiles Sass to CSS, runs Autoprefixer and loads in Bower dependencies.
  • watch - Automatically watches the directories of the source files in the config. e.g. if scripts/main.js is the source file, scripts/**/*.js will be watched.

When running any of these tasks, a --production flag can be used to minify the compiled CSS/JavaScript.

var gulp = require('gulp');

require('@simpleweb/gulp').auto(gulp, {
  styles: {
    src: './styles.scss',
    dest: './dist'
  },
  scripts: {
    src: './main.js',
    dest: './dist'
  },
});

Installation

Install the module from NPM by running the following.

$ npm install @simpleweb/gulp --save-dev

Then require it in your gulpfile.js.

var tasks = require('@simpleweb/gulp').tasks;

Tasks

Styles

Compiles Sass, can concatenate Bower dependencies and can pass everything through Autoprefixer.

Example
gulp.task('styles', function() {
  return tasks.styles({
      src: './styles/styles.scss',
      bower: true,
      autoprefixer: true
    })
    .pipe(gulp.dest('./tmp'))
  ;
});
Parameters

|argument|type|default|description| |---|---|---|---| | src | String | | Path to the main Sass file | | bower | Boolean | false | Whether to load in Bower dependencies. If true, bower.json must exist along with it's components folder | | autoprefixer | Object/Boolean | false | You can use all autoprefixer options or pass true to run with default options |

Flags

A production flag can be passed to minify the CSS for production.

$ gulp styles --production

Sass

Compiles Sass into CSS using gulp-sass.

Example
gulp.task('sass', function() {
  return tasks.sass('./main.scss')
    .pipe(gulp.dest('./css'));
});
Parameters

|argument|type|default|description| |---|---|---|---| | src | String | | Path to the main Sass file | | options | Object | {} | You can use all the node-sass options |

ES6

Compiles ES6 into JavaScript that's ES5 compliant. ES3 transforms are applied to it as well, so it will work with IE8. However, you will still need to use the shim and sham with it.

Example
gulp.task('es6', function() {
  return tasks.es6('./main.js')
    .pipe(gulp.dest('./js'))
  ;
});
Parameters

|argument|type|default|description| |---|---|---|---| | src | String | | Path to the main ES6 file |

Scripts

Compiles ES6 into JavaScript that's ES5 compliant and can bundle in your Bower dependencies.

Example
gulp.task('scripts', function() {
  return tasks.scripts({
      src: './main.js',
      bower: true
    })
    .pipe(gulp.dest('./js'))
  ;
});
Parameters

|argument|type|default|description| |---|---|---|---| | src | String | | Path to the main ES6 file | | bower | Boolean | false | Whether to load in Bower dependencies. If true, bower.json must exist along with it's components folder |

Flags

A production flag can be passed to minify the CSS for production.

$ gulp scripts --production

Development

Setup

You can work on this locally without having to continuously publish to NPM. After cloning the repo down, cd into the directory and run npm link. This will create a symbolic in your global modules folder.

To install it in a project and test out, run npm link @simpleweb/gulp. You can then require it like you usually would. This is the equivalent of running npm install @simpleweb/gulp except it uses the symbolic link in your global modules folder.

Adding a task

To create a new task think of a clear and descriptive name and create a file for it in the tasks directory.

$ touch tasks/hello-world.js

In the file that was just created, export the main function for that task.

module.exports = function() {
  console.log('Hello world');
};

At the top of index.js, require the task and give it a clear constant name.

const hello_world = require('./tasks/hello-world');

Finally, add the module to the exports line.

module.exports = { sass, hello_world };