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 🙏

© 2025 – Pkg Stats / Ryan Hefner

gulpcommons

v0.0.11

Published

Common gulp tasks repository/generator

Readme

Gulpcommons

Common gulp tasks repository/generator

Dependencies

You might want to install some of the following dependencies to unlock all the features:

  • gulp-clean ^0.4.0 used in all built-in suites to generate clean* tasks.
  • gulp-typescript ^6.0.0-alpha.1 used in built-in typescript suite to generate compileTypescript* tasks.
  • gulp-sass ^5.1.0 and sass ^1.49.8 used in built-in sass suite to generate compileSass* tasks

Built-in

This is an example gulpfile that uses the built-in tasks.

const gulp = require('gulp')
const {tasks} = require('gulpcommons')

gulp.task('build', gulp.parallel(
    // main
    tasks.compileMainTypescript,
    tasks.bundleMainResources,
    // test
    tasks.compileTestTypescript,
    tasks.bundleTestResources,
    // client
    tasks.compileClientTypescript,
    tasks.compileClientSass,
    tasks.bundleClientStatic,
    tasks.bundleClientViews,
    // config
    tasks.bundleConfigEnv
))
gulp.task('clean', gulp.parallel(
    // main
    tasks.cleanMainTypescript,
    tasks.cleanMainResources,
    // test
    tasks.cleanTestTypescript,
    tasks.cleanTestResources,
    // client
    tasks.cleanClientTypescript,
    tasks.cleanClientSass,
    tasks.cleanClientStatic,
    tasks.cleanClientViews,
    // config
    tasks.cleanConfigEnv,
))
gulp.task('watch', gulp.series('clean', 'build', gulp.parallel(
    // main
    tasks.watchMainTypescript,
    tasks.watchMainResources,
    // test
    tasks.watchTestTypescript,
    tasks.watchTestResources,
    // client
    tasks.watchClientTypescript,
    tasks.watchClientSass,
    tasks.watchClientStatic,
    tasks.watchClientViews,
    // config
    tasks.watchConfigEnv,
)))

You could optionally tweak the built-in tasks as follows:

const {sources} = require('gulpcommons')

sources.main.input = './src/main/typescript/**/*.ts'
sources.main.tsconfig = './src/main/typescript/tsconfig.json'
sources.main.output = './build/javascript/main'

Also, you could register all the tasks to gulp:

const {tasks} = require('gulpcommons')

tasks.install()

Also, you can dynamically generate your custom tasks as follows:

const gulp = require('gulp')
const {tasks, sources, generate, install} = require('gulpcommons')

// first define the sources
sources.mySourceSet = {
    myTypescript: {
        type: tasks.suites.typescript,
        input: './src/my-source-set/my-typescript/**/*.ts',
        output: './build/my-source-set/my-typescript',
        tsconfig: './src/my-source-set/my-typescript/tsconfig.json'
    },
    mySass: {
        type: tasks.suites.sass,
        input: './src/my-source-set/my-sass/**/*.sass',
        output: './build/my-source-set/my-sass'
    },
    myBundle: {
        type: tasks.suites.bundle,
        input: './src/my-source-set/my-bundle/**/*.*',
        output: './build/my-source-set/my-bundle'
    }
}

// then generate the tasks
generate()

// optional: register the tasks to gulp
install()

// finally add them to the build, clean and watch tasks
gulp.task('build', gulp.parallel(
    /* ... */
    tasks.compileMySourceSetMyTypescript,
    tasks.compileMySourceSetMySass,
    tasks.bundleMySourceSetMyBundle,
))
gulp.task('clean', gulp.parallel(
    /* ... */
    tasks.cleanMySourceSetMyTypescript,
    tasks.cleanMySourceSetMySass,
    tasks.cleanMySourceSetMyBundle,
))
gulp.task('watch', gulp.series('clean', 'build', gulp.parallel(
    /* ... */
    tasks.watchMySourceSetMyTypescript,
    tasks.watchMySourceSetMySass,
    tasks.watchMySourceSetMyBundle,
)))