Gathering detailed insights and metrics for gulp4-run-sequence
Gathering detailed insights and metrics for gulp4-run-sequence
Gathering detailed insights and metrics for gulp4-run-sequence
Gathering detailed insights and metrics for gulp4-run-sequence
npm install gulp4-run-sequence
Typescript
Module System
Node Version
NPM Version
95.8
Supply Chain
100
Quality
78.1
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
4,177,923
Last Day
3,963
Last Week
3,963
Last Month
72,415
Last Year
1,078,977
10 Stars
138 Commits
3 Watching
1 Branches
2 Contributors
Minified
Minified + Gzipped
Latest Version
1.0.2
Package Id
gulp4-run-sequence@1.0.2
Unpacked Size
11.09 kB
Size
4.55 kB
File Count
4
NPM Version
8.9.0
Node Version
18.2.0
Publised On
15 May 2023
Cumulative downloads
Total Downloads
Last day
0%
3,963
Compared to previous day
Last week
-73%
3,963
Compared to previous week
Last month
7.5%
72,415
Compared to previous month
Last year
-9.6%
1,078,977
Compared to previous year
run-sequence
for gulp 4
Run a sequence of tasks, in the order you specify, as part of a greater task.
(This package aims to help tasks, formerly dependent on run-sequence
for gulp 3
, run in gulp 4
.)
1const gulp = require('gulp'); 2const runSequence = require('gulp4-run-sequence'); 3const fs = require('fs'); 4 5// This will run in this order: 6// * 'boil-water' 7// * 'steep-tea' and 'boil-egg' concurrently 8// * 'peel-egg' 9// * Finally, the callback function. 10gulp.task('breakfast', function (callback) { 11 runSequence( 12 'boil-water', 13 ['steep-tea', 'boil-egg'], 14 'peel-egg', 15 callback 16// ^^^^^^^^ 17// This informs that the sequence is complete. 18 ); 19}); 20 21// Configure boil-water, steep-tea, boil-egg, and peel-egg as you wish, 22// but make sure they return a stream or promise, or handle the callback. 23// Examples: 24 25gulp.task('boil-water', function () { 26 // Return the stream from gulp. 27 return gulp.src('water').pipe(...)... 28}); 29 30gulp.task('boil-egg', function () { 31 return new Promise(function (resolve, reject) { 32 // Make sure asynchronous tasks are resolved or rejected. 33 }); 34}); 35 36gulp.task('peel-egg', function (callback) { 37 fs.readFile('egg', function (err, data) { 38 // Consume data... 39 callback(); 40// ^^^^^^^^ 41// This informs that the task is complete. 42 }); 43});
gulp
submodulesIf you have a complex gulp
setup, with your tasks split up across different
files, gulp4-run-sequence
might not be able to find every task, and will error
that such tasks were never defined. In this case, you can configure
gulp4-run-sequence
to look at the gulp
within the submodule, like so:
1// Explicitly declare gulp particular to your submodule. 2const gulp = require('./path/to/gulp'); 3// Explicitly assign this gulp to gulp4-run-sequence. 4const runSequence = require('gulp4-run-sequence').use(gulp); 5 6// ...and then use normally. 7gulp.task('supertask', function (callback) { 8 runSequence('subtask0', 'subtask1', callback); 9});
errorOnInvalidArgumentType
: Set this to true in order to throw an error if an
invalid argument type has been passed. The only valid argument types are string,
array, and function.
Example:
1runSequence.options.errorOnInvalidArgumentType = true; 2 3gulp.task('task', function (cb) { 4 // null is neither string, array, nor function, so this will error: 5 runSequence('foo', null, 'bar', cb); 6});
The options in the gulp 3
version of run-sequence
no longer apply.
showErrorStackTrace
no longer applies because errors are handled entirely
within the gulp 4
stack. A good command of streams, promises, and callback
functions will deliver the desired amount of error verbosity.
ignoreUndefinedTasks
no longer applies because falsy arguments will either be
skipped without warning (default behavior), or cause an error if
errorOnInvalidArgumentType
is set to true
.
Computational tasks might be too abstract for visualizing sequences and concurrency. It's much easier to visualize steeping tea and boiling eggs concurrently, but only after water has come to a boil.
It might also be irresponsible to suggest running certain tasks concurrently, when concurrent operation would not be optimal for those tasks.
First, we need to understand what "parallel", "concurrent", and "asynchrony" mean in terms of computing.
"Parallel" computing refers to distributing processes across multiple processor cores.
"Concurrent" computing refers to running multiple processes in such a way, that they appear to be running at the same time. This can be accomplished by rapidly switching between the processes on one processor core.
"Asynchrony" refers to when a process runs outside the main execution flow, and the main execution might need a response. If it does, it must not block other processes that don't depend on the response, while it waits.
JavaScript, and Node.js in particular, are frequently referred to as being
"single-threaded". In recent years, this has become wholly untrue. If you are
working on production-level parallel JavaScript, firstly, kudos! Secondly, we're
not sure why you're reading this, but thanks for checking out
gulp4-run-sequence
!
Now consider a procedure found in nearly every gulp
implementation: a file
read. It is not a good idea to read files concurrently on a single machine, even
if it has many processor cores. We should assume the machine has a single disk
drive, and that the drive has a single read/write head. Even if those aren't the
case, we should assume there is only one pathway open at a given time, on which
the data can travel from drive to memory.
Let's make a culinary analogy: Assume we need 2 liters of warm water evenly mixed from a cold tap and a hot tap. However, the taps are 10 meters apart. Any rational person would mix the water sequentially, filling a liter of cold water, walking the 10 meters, and filling another liter of hot water.
Trying to make this water gathering appear concurrent by filling smaller amounts of water at a time, and walking more, is called "thrashing" if applied to a disk drive!
This package is inspired entirely by
run-sequence
for gulp 3
.
Credit and gratitude are due for
its contributors.
gulp 3
with long-term supportNo vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
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
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