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 🙏

© 2024 – Pkg Stats / Ryan Hefner

gulp-ll-next

v2.1.0

Published

Run CPU-consuming Gulp tasks in the separate processes to achieve faster builds.

Downloads

1,104

Readme

Install

npm install --save-dev gulp-ll

Usage

Declare which tasks should be run in parallel before any task declaration:

var gulp = require('gulp');
var ll   = require('gulp-ll');

ll.tasks(['lint', 'compile-scripts']);

gulp.task('lint', ['dep'], () => {
// Task code...
});

gulp.task('compile-scripts', ['dep'], () => {
// Task code...
});

gulp.task('dep', () => {
// This task will run in the master process ONCE before 'lint' and 'compile-scripts' begin.
});

And we're set :tada:

So, now my builds will run faster, right?

It depends. Node processes are quite slow to spawn. So, running tasks in the separate processes could be slower than executing them sequentially in the single process. You need to play a little bit with the configuration (using time gulp your-task) to figure out the optimal one. E.g. I was able to reach maximum performance (~30% faster) by using gulp-ll only for the the heaviest CPU-consuming task out of 3 in my project. Performance gain also depends on the codebase size: obviously, it will give better results in the big projects.

Faster debugging sessions

Node process may become painfully slow in the debugging mode. Sometimes, when you trying to debug your tests by running test task that depends on scripts compilation, linting, etc. it may take ages to reach the desired breakpoint. This is there gulp-ll come in handy - it will run heavy gulp tasks in the separate processes with the regular speed. Taking in consideration what was told in the previous paragraph, more likely you will not want to run all your heavy tasks in the separate processes. But, you can force them to to do so only in the debug:

ll
    // Always run in separate process
    .tasks('lint')
    // Run in separate process only in debug
    .onlyInDebug('compile-scripts', 'build-templates');

How I can debug task if it's in separate process?

You can just disable gulp-ll by running Gulp with --no-ll parameter:

gulp my-task --no-ll

Caveats

More likely gulp-ll will not work for you if you have global variables set by one task and used by another. Apart from the topic, I suggest you to never do so.

Author

Ivan Nikulin ([email protected])