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

gulp-builders

v1.0.1

Published

make gulp build easier!

Readme

#gulp-builders

##make gulp build easier !

  • open multi modules for listeners(diff ports), see example bellow
  • build multi modules
  • config ModuleModel and CommonModel path
  • tinypng to compress images
  • custom html template

config package.json

{
    "devDependencies": {
        "gulp": "github:gulpjs/gulp#4.0",
        "gulp-mbuilder": "^1.0.0"
    }
}

config gulpfile.babel.js

import gulp from "gulp";
import {Build, ModuleModel, CommonModel} from "gulp-mbuilder";  //"./build-script-output/src/Build";

let commonModel = new CommonModel();
let modules = [new ModuleModel("20170915hd", 7780, "index")];

gulp.task('default', Build.run(modules, commonModel));          //no imageMin and zip
gulp.task('build', Build.build(modules, commonModel));          //do imageMin and zip
gulp.task('clean', Build.clean());                              //remove ./build/

run project

$ gulp

build project

$ gulp build

clean project

$ gulp clean

publish to npm

npm pack && npm publish

Unresolved function or method

    //Issues when coding node.js using IntelliJ IDEA , please check all
    IntelliJ IDEA -> Preferences -> JavaScript -> Libraries 
        -> [Ensure 'Node.js Globals' is checked]

gulp upgrade to 4.0

    # Uninstall previous Gulp installation and related packages, if any
    $ npm rm gulp -g
    $ npm rm gulp-cli -g
    $ cd [your-project-dir/]
    $ npm rm gulp --save-dev
    $ npm rm gulp --save
    $ npm rm gulp --save-optional
    $ npm cache clean
    
    # Install the latest Gulp CLI tools globally
    $ npm install gulpjs/gulp-cli -g
    
    # Install Gulp 4 into your project from 4.0 GitHub branch as dev dependency
    $ npm install gulpjs/gulp#4.0 --save-dev
    
    # Check the versions installed. Make sure your versions are not lower than shown.
    $ gulp -v

src dirs

  • dirs in project
.
├── README.md
├── build
├── gulpfile.babel.js
├── node_modules
├── package-lock.json
├── package.json
└── src
  • dirs in project/src
.
├── base
│   ├── common
│   │   ├── img
│   │   │   ├── backtop.png
│   │   │   └── share.png
│   │   ├── js
│   │   │   └── common.js
│   │   └── scss
│   │       ├── _common.scss
│   │       ├── _mixins.scss
│   │       ├── _reset.scss
│   │       └── main.scss
│   └── plugins
│       ├── sm
│       │   ├── sm.min.css
│       │   └── sm.min.js
│       ├── url.min.js
│       ├── vue-resource.min.js
│       └── vue.min.js
├── modules
│   └── 20170915hd
│       ├── html
│       │   └── index.html
│       ├── js
│       │   └── index.js
│       └── scss
│           └── index.scss
└── templates
    ├── adds
    │   ├── links.html
    │   ├── scripts.html
    │   └── tools.html
    ├── template-clean.html
    └── template.html

example run

$ gulp
[17:18:42] Requiring external module babel-register
[17:18:43] Using gulpfile ~/workspace/template/gulp/gulpfile.babel.js
[17:18:43] Starting 'default'...
[17:18:43] Starting 'cleanTask'...
[17:18:43] Starting 'cleanTask'...
[17:18:43] Finished 'cleanTask' after 12 ms
[17:18:43] Finished 'cleanTask' after 14 ms
[17:18:43] Starting 'buildImagesTask'...
[17:18:43] Starting 'buildImagesCommonTask'...
[17:18:43] Starting 'buildScssCommonTask'...
[17:18:43] Starting 'buildJsCommonTask'...
[17:18:43] Starting 'buildPluginsTask'...
[17:18:43] Starting 'buildScssTask'...
[17:18:43] Starting 'buildJsTask'...
[17:18:43] Starting 'buildHtmlTask'...
[17:18:43] Starting 'buildImagesTask'...
[17:18:43] Starting 'buildImagesCommonTask'...
[17:18:43] Starting 'buildScssCommonTask'...
[17:18:43] Starting 'buildJsCommonTask'...
[17:18:43] Starting 'buildPluginsTask'...
[17:18:43] Starting 'buildScssTask'...
[17:18:43] Starting 'buildJsTask'...
[17:18:43] Starting 'buildHtmlTask'...
[17:18:43] Finished 'buildImagesTask' after 42 ms
[17:18:43] Finished 'buildImagesTask' after 42 ms
not find custom template: Error: ENOENT: no such file or directory, access './src/templates/20170915hd.html' and will use default template : ./src/templates/template.html
[17:18:43] Finished 'buildHtmlTask' after 270 ms
not find custom template: Error: ENOENT: no such file or directory, access './src/templates/20170915hd.html' and will use default template : ./src/templates/template.html
[17:18:43] Finished 'buildHtmlTask' after 271 ms
[17:18:44] Finished 'buildJsCommonTask' after 475 ms
[17:18:44] Finished 'buildJsTask' after 479 ms
[17:18:44] Finished 'buildJsCommonTask' after 480 ms
[17:18:44] Finished 'buildJsTask' after 527 ms
[17:18:44] Finished 'buildImagesCommonTask' after 531 ms
[17:18:44] Finished 'buildImagesCommonTask' after 532 ms
[17:18:44] Finished 'buildScssTask' after 588 ms
[17:18:44] Finished 'buildScssTask' after 588 ms
[17:18:44] Finished 'buildScssCommonTask' after 596 ms
[17:18:44] Finished 'buildScssCommonTask' after 596 ms
[17:18:44] Finished 'buildPluginsTask' after 612 ms
[17:18:44] Starting 'syncTask'...
[17:18:44] Starting 'watchTask'...
[17:18:44] Finished 'buildPluginsTask' after 650 ms
[17:18:44] Starting 'syncTask'...
[17:18:44] Starting 'watchTask'...
[Browsersync] Access URLs:
 -------------------------------------
       Local: http://localhost:7780
    External: http://10.47.60.128:7780
 -------------------------------------
          UI: http://localhost:7880
 UI External: http://10.47.60.128:7880
 -------------------------------------
[Browsersync] Serving files from: ./build/
[Browsersync] Access URLs:
 -------------------------------------
       Local: http://localhost:7781
    External: http://10.47.60.128:7781
 -------------------------------------
          UI: http://localhost:7881
 UI External: http://10.47.60.128:7881
 -------------------------------------
[Browsersync] Serving files from: ./build/

example build

gulp build
[17:27:30] Requiring external module babel-register
[17:27:31] Using gulpfile ~/workspace/template/gulp/gulpfile.babel.js
[17:27:31] Starting 'build'...
[17:27:31] Starting 'cleanTask'...
[17:27:31] Starting 'cleanTask'...
[17:27:31] Finished 'cleanTask' after 10 ms
[17:27:31] Finished 'cleanTask' after 12 ms
[17:27:31] Starting 'buildImagesTask'...
[17:27:31] Starting 'buildImagesCommonTask'...
[17:27:31] Starting 'buildScssCommonTask'...
[17:27:31] Starting 'buildJsCommonTask'...
[17:27:31] Starting 'buildPluginsTask'...
[17:27:31] Starting 'buildScssTask'...
[17:27:31] Starting 'buildJsTask'...
[17:27:31] Starting 'buildHtmlTask'...
[17:27:31] Starting 'buildImagesTask'...
[17:27:31] Starting 'buildImagesCommonTask'...
[17:27:31] Starting 'buildScssCommonTask'...
[17:27:31] Starting 'buildJsCommonTask'...
[17:27:31] Starting 'buildPluginsTask'...
[17:27:31] Starting 'buildScssTask'...
[17:27:31] Starting 'buildJsTask'...
[17:27:31] Starting 'buildHtmlTask'...
[17:27:31] gulp-tinypng-nokey : [compress completed] skiped: 0 imgs, compressed: 0 imgs, totalSize: 0%
[17:27:31] gulp-tinypng-nokey : [compress completed] skiped: 0 imgs, compressed: 0 imgs, totalSize: 0%
[17:27:31] Finished 'buildImagesTask' after 49 ms
[17:27:31] Finished 'buildImagesTask' after 48 ms
not find custom template: Error: ENOENT: no such file or directory, access './src/templates/20170915hd.html' and will use default template : ./src/templates/template.html
[17:27:31] Finished 'buildHtmlTask' after 239 ms
not find custom template: Error: ENOENT: no such file or directory, access './src/templates/20170915hd.html' and will use default template : ./src/templates/template.html
[17:27:31] Finished 'buildHtmlTask' after 239 ms
[17:27:31] gulp-tinypng-nokey : [tinypng request] backtop.png
[17:27:32] gulp-tinypng-nokey : [tinypng request] backtop.png
[17:27:32] Finished 'buildJsCommonTask' after 452 ms
[17:27:32] Finished 'buildJsTask' after 456 ms
[17:27:32] Finished 'buildJsTask' after 456 ms
[17:27:32] Finished 'buildJsCommonTask' after 459 ms
[17:27:32] Finished 'buildScssTask' after 526 ms
[17:27:32] Finished 'buildScssTask' after 526 ms
[17:27:32] Finished 'buildScssCommonTask' after 558 ms
[17:27:32] Finished 'buildScssCommonTask' after 560 ms
[17:27:32] Finished 'buildPluginsTask' after 564 ms
[17:27:32] Finished 'buildPluginsTask' after 571 ms
[17:27:34] gulp-tinypng-nokey : [compressing] Ok backtop.png (97.3%)
[17:27:34] gulp-tinypng-nokey : [tinypng request] share.png
[17:27:35] gulp-tinypng-nokey : [compressing] Ok backtop.png (97.3%)
[17:27:35] gulp-tinypng-nokey : [tinypng request] share.png
[17:27:35] gulp-tinypng-nokey : [compressing] Ok share.png (97.7%)
[17:27:35] gulp-tinypng-nokey : [compress completed] skiped: 0 imgs, compressed: 3 imgs, totalSize: 97.38%
[17:27:35] Finished 'buildImagesCommonTask' after 4.24 s
[17:27:35] Starting 'buildZipTask'...
[17:27:35] Finished 'buildZipTask' after 4.78 ms
[17:27:36] gulp-tinypng-nokey : [compressing] Ok share.png (97.7%)
[17:27:36] gulp-tinypng-nokey : [compress completed] skiped: 0 imgs, compressed: 4 imgs, totalSize: 97.43%
[17:27:36] Finished 'buildImagesCommonTask' after 5.24 s
[17:27:36] Starting 'buildZipTask'...
[17:27:36] Finished 'buildZipTask' after 4.22 ms
[17:27:36] Finished 'build' after 5.27 s
maokangren:gulp maokangren$