Gathering detailed insights and metrics for run-sequence
Gathering detailed insights and metrics for run-sequence
npm install run-sequence
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
100,289,416
Last Day
27,467
Last Week
27,467
Last Month
397,051
Last Year
6,732,565
959 Stars
91 Commits
56 Forks
15 Watching
1 Branches
13 Contributors
Minified
Minified + Gzipped
Latest Version
2.2.1
Package Id
run-sequence@2.2.1
Size
5.74 kB
NPM Version
5.6.0
Node Version
9.3.0
Publised On
03 Jan 2018
Cumulative downloads
Total Downloads
Last day
0%
27,467
Compared to previous day
Last week
-64.2%
27,467
Compared to previous week
Last month
-1.7%
397,051
Compared to previous month
Last year
-17.1%
6,732,565
Compared to previous year
Runs a sequence of gulp tasks in the specified order. This function is designed to solve the situation where you have defined run-order, but choose not to or cannot use dependencies.
Is your company hiring Node developers?
If you are hiring developers, you can support this project and future open source work by checking out our company, Qualified.io.
Qualified is a service for online skills-assessment that can help you easily vet developers across a wide range of real-world programming skills.
Please help support this project, and sign up for a free trial.
Each argument to run-sequence
is run in order. This works by listening to the task_stop
and task_err
events, and keeping track of which tasks have been completed. You can still run some of the tasks in parallel, by providing an array of task names for one or more of the arguments.
If the final argument is a function, it will be used as a callback after all the functions are either finished or an error has occurred.
Please Note
This was intended to be a temporary solution until the release of gulp 4.0 which should have support for defining task dependencies similarly.
Given that Gulp 4 appears to never be fully released, take that for what you will. Be aware that this solution is a hack, and may stop working with a future update to gulp.
First, install run-sequence
as a development dependency:
1npm install --save-dev run-sequence
Then add use it in your gulpfile, like so (note these are only examples, please check the documentation for your functions for the correct way to use them):
1var gulp = require('gulp'); 2var runSequence = require('run-sequence'); 3var del = require('del'); 4var fs = require('fs'); 5 6// This will run in this order: 7// * build-clean 8// * build-scripts and build-styles in parallel 9// * build-html 10// * Finally call the callback function 11gulp.task('build', function(callback) { 12 runSequence('build-clean', 13 ['build-scripts', 'build-styles'], 14 'build-html', 15 callback); 16}); 17 18// configure build-clean, build-scripts, build-styles, build-html as you wish, 19// but make sure they either return a stream or promise, or handle the callback 20// Example: 21 22gulp.task('build-clean', function() { 23 // Return the Promise from del() 24 return del([BUILD_DIRECTORY]); 25// ^^^^^^ 26// This is the key here, to make sure asynchronous tasks are done! 27}); 28 29gulp.task('build-scripts', function() { 30 // Return the stream from gulp 31 return gulp.src(SCRIPTS_SRC).pipe(...)... 32// ^^^^^^ 33// This is the key here, to make sure tasks run to completion! 34}); 35 36gulp.task('callback-example', function(callback) { 37 // Use the callback in the async function 38 fs.readFile('...', function(err, file) { 39 console.log(file); 40 callback(); 41// ^^^^^^^^^^ 42// This is what lets gulp know this task is complete! 43 }); 44});
If you have a complex gulp setup with your tasks split up across different files, you may get the error that run-sequence
is unable to find your tasks. In this case, you can configure run-sequence
to look at the gulp within the submodule, like so:
1// submodule tasks/mygulptask.js 2 3var gulp = require('gulp'), // might be a different instance than the toplevel one 4 // this uses the gulp you provide 5 runSequence = require('run-sequence').use(gulp); 6 7 // ...and then use normally 8 runSequence('subtask1', 'subtask2');
There are a few global options you can configure on the runSequence
function.
Please note these are global to the module, and once set will affect every use of runSequence
.
Usage:
1var runSequence = require('run-sequence'); 2runSequence.options.ignoreUndefinedTasks = true; 3gulp.task('task', function(cb) { 4 runSequence('foo', null, 'bar'); // no longer errors on `null` 5})
showErrorStackTrace
: When set to false
, this suppresses the full stack trace from errors captured during a sequence.ignoreUndefinedTasks
: When set to true
, this enables you to pass falsey values in which will be stripped from the task set before validation and sequencing.No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 8/27 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
30 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More