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-tasks-preset

v0.4.2

Published

A gulp workflow containing common tasks I use at projects.

Readme

Gulp Tasks Preset

A set of gulp workflows I commonly use in projects


Table of Contents


Installation

The preset requires node version at least 7.10.1.

  • Install the package through npm. We will include gulp since it needs to be installed locally as well.
    npm install --save-dev gulp-tasks-preset gulp
  • Install the preset files by running the executable. This will prompt you to replace an existing gulpfile, if there is any.
    ./node_modules/.bin/gulp-tasks-preset
    NOTE: You only need to install the preset files ONCE during fresh setup. Reinstalling after the files are updated would result to them being reverted to the default.

Environment Setup

A .env file is required for the gulp tasks to be selected according to the environment. This expects an ENV variable, which can be LOCAL, DEVELOPMENT, STAGING, orPRODUCTION.


Gulpfile

The gulpfile will only contain a way to register your desired tasks. Provided are 3 lists of tasks:

  • tasks - Tasks that you expect to run on all environments
  • devOnlyTasks - Tasks that you expect to run only on LOCAL or DEVELOPMENT environments
  • prodOnlyTasks - Tasks that you expect to run only on STAGING or PRODUCTION environments

By default, task files are placed in the gulp folder. You can move the task files to a different folder. Just update the gulpfile accordingly:

// gulpfile.js

// On the last line, pass the folder name as second argument
registerTasks(tasks, 'new/tasks/folder');

Tasks included

Lint Styles

Uses gulp-sass-lint as SASS linter. A default .sass-lint.yml file is provided. For details about the config, please refer to this link: https://github.com/sasstools/sass-lint#configuring.

Lint Scripts

Uses gulp-jshint. A default .jshintrc file is provided. It's default esversion setting is 6, due to es8(or next) still under the works on JSHint's end.

Scripts

Uses Rollup to bundle es6 modules, and Babel to transpile ES versions. Default config files rollup.config.js and .babelrc are provided.

By default, babel is using the env in order to support the latest ES versions. However, if your current project requires more of the latest ES version, you would have to configure babel to support them (such as installing transform plugins, etc.). This is just a barebones to get you started on a project utilising modules and es2015+.

Styles

Uses SASS precompiler.

Sprites

Combines SVG icons into a single file as SVG symbols. Uses gulp-svg-sprite.

Images

Optimizes image assets. Uses gulp-imagemin.

Fonts

Simply copies fonts into the public or dist folder.

Vendors

Simply concatenates vendors scripts and stylesheets.

A config file vendors.config.js has been provided to manage lists of vendor files. When running in watch, any change in the config file triggers the task to run. This allow you to add and remove vendor files without having to restart gulp over and over.

Default and Watch

Default task will automatically run all the registered tasks in your gulpfile.

Watch task will only be registered if you run gulp watch.

The watch task is in its own file, so you have the freedom to customize/override it (e.g., if you want to use proxy for the browserSync, etc.). It uses gulp-watch plugin to allow new files to be included in the watch, which cannot be done with the native gulp.watch.


Creating New Tasks

Every task should be on its own file inside gulp folder. You may use _sampleTask.js as a template for your new task. The task's filename will be used as the gulp task's name. So a copy-files task should be in copy-files.js task.

The existing tasks are designed to be environment-aware. It is recommended that you design new tasks in such way too.


Environment Aware

The preset leverages the use of environment variables accross all tasks and configurations in order to efficiently select stuff that will be used only on a specific environment. Some of these features are:

  • Local/Development
    • Assets are not minified
    • Sourcemaps are included
    • Linter tasks are available
    • Watch task is available
  • Staging/Production
    • Assets are minified
    • CSS media queries are combined
    • No sourcemaps

All the environment variables and other helpers are available when you require the gulp directory. These are helpful when you build your own tasks.