Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Features and utilities to simplify advanced gulpfiles.
All of these can be changed, but without providing specific values for them, theses are biggulp
's defaults:
{
allSpecPaths: [ "./spec" ],
behaviorSpecPaths: [ "./spec/behavior" ],
integrationSpecPaths: [ "./spec/integration" ],
specs: [ "**/*.spec.js" ],
watchPaths: [ "./src/**/*", "./spec/**/*", "./resource/**/*" ],
sources: [ "*.js", "{resource,src,spec}/**/*.js" ],
jscsCfgPath: ".jscsrc"
}
A reference to the gulp instance in your gulpfile must always be passed as the first argument. Any properties you provide on the options argument will override its corresponding defaults.
var gulp = require( "gulp" );
var bg = require( "biggulp" )( gulp );
// overriding allSpecPaths
var bg = require( "biggulp" )( gulp, { allSpecPaths: [ "./test" ] } );
Runs specifications via Mocha.
Run tests that match testGlob
- the test pattern to use (relative to the default/root spec path). Default is "**/*.spec.js"
.
gulp.task( "specs", function() {
return bg.test( "./spec/justThisSpec.js" );
} );
Like test
except it uses an exit code to indicate pass/fail (0 pass, >0 fail).
gulp.task( "specs", function() {
return bg.testOnce( "./spec/justThisSpec.js" );
} );
Run tests that match the test pattern defined in the options' specs
property and that fall under any of the directories listed under the options' specPaths
array. The options
argument allows you to pass a configuration other than what you passed to biggulp's factory to begin with.
gulp.task( "test-everything", function() {
return bg.testAll();
} );
Like testAll
except it uses an exit code to indicate pass/fail (0 pass, >0 fail).
Run tests that match the test pattern defined in the options' specs
property and that fall under any of the directories listed under the options' behaviorSpecPaths
array. The options
argument allows you to pass a configuration other than what you passed to biggulp's factory to begin with.
gulp.task( "test-behavior", function() {
return bg.testBehavior();
} );
Like testBehavior
except it uses an exit code to indicate pass/fail (0 pass, >0 fail).
Run tests that match the test pattern defined in the options' specs
property and that fall under any of the directories listed under the options' integrationSpecPaths
array. The options
argument allows you to pass a configuration other than what you passed to biggulp's factory to begin with.
gulp.task( "test-behavior", function() {
return bg.testIntegration();
} );
Like testIntegration
except it uses an exit code to indicate pass/fail (0 pass, >0 fail).
Creates a file watcher for the patterns specified in either the global biggulp options watchPaths
array (defaults to [ "./src/**/*", "./spec/**/*", "./resource/**/*" ]
) – or in the options argument's watchPaths
array – and executes the array of tasks when a file changes.
gulp.task( "watch", function() {
return bg.watch( [ "specs" ] );
} );
Istanbul is a great library that provides code coverage metrics. Use it, you won't be sorry.
Works like test
but adds a console report showing test coverage as measured by Istanbul.
gulp.task( "coverage", function() {
bg.withCoverage();
} );
Like withCoverage
but also displays the browser report and then exits the process.
gulp.task( "show-coverage", function() {
return bg.showCoverage();
} );
Ngrok is a tunneling service that allows you to expose a local service publicly.
Note: the free version does not reserve/guarantee your subdomain.
Sets up an ngrok tunnel and returns a promise which resolves to the public url once the tunnel is ready. You can pass the ngork options in as the options
argument, or it will use defaults you've set when you pass options to biggulp's module factory.
Note: the ngrok instance is required to eliminate always installing ngrok as a dependency for biggulp when not in-use.
var ngrok = require( "ngrok" );
bg.grok( ngrok, { domain: "mahDomain", port: 8800, token: "anToken" } )
.then( function( url ) {
console.log( "Tunneling", url, "to 8800" );
} );
Uses processhost to start/restart OS processes. See processhost README for details on options.
Notes:
- if you're using watch tasks,
biggulp
will restart all processes defined this way for you on file changes.
- processes with the
restart
option set to false will not restart on file changes.
Use when you only need to manage a single process along with your tests. Returns a promise that resolves on process start.
bg.process( "redis", { cmd: "redis-server", stdio: "ignore", restart: false } )
.then( function() {
// everything is ready to go
} );
Use when you need several processes. Returns a promise that resolves after all processes start.
bg.processes(
{
server: { args: [ "./src/index.js" ] },
redis: { cmd: "redis-server", stdio: "ignore", restart: false }
} )
.then( function() {
// everything is ready to go
} )
We've discovered many of our node-only and OSS libs typically have the same tasks. We've created a common-gulp
module at the root of this project that you can include to automatically define these tasks. If you go this route, your gulpfile would look like this:
// gulpfile.js
var bg = require( "biggulp/common-gulp" )( require( "gulp" ) );
/*
Gives you the following tasks:
├─┬ ?
│ └── help
├── about
├── continuous-test
├─┬ coverage
│ └── format
├─┬ coverage-watch
│ └── coverage
├─┬ default
│ ├── coverage
│ └── coverage-watch
├─┬ format
│ └── jshint
├── help
├── jshint
├── restartProcesses
├── show-coverage
├─┬ test
│ └── coverage
├─┬ test-and-exit
│ └── jshint
├── test-behavior
├── test-int
├─┬ test-watch
│ └── continuous-test
*/
NOTE: Biggulp actually uses this approach for its gulpfile - biggulp-ception™.
This example has tasks that demonstrate the following "recipes":
var gulp = require( "gulp" );
// uses default paths
var bg = require( "biggulp" )( gulp );
// a task to pass default tests to istanbul
// results in a coverage report at the end of
// test run
gulp.task( "coverage", function() {
bg.withCoverage();
} );
// a watch task against default paths and
// run the coverage task on file changes
gulp.task( "coverage-watch", function() {
bg.watch( [ "coverage" ] );
} );
// open a browser after the test run and exit
gulp.task( "show-coverage", function() {
return bg.showCoverage();
} );
// just run the specs via mocha
gulp.task( "continuous-specs", function() {
return bg.testAll();
} );
// sets up a watch on default paths and
// runs the `continuous-specs` task on file change
gulp.task( "specs-watch", function() {
bg.watch( [ "continuous-specs" ] );
} );
// run specs and exit with a code to indicate pass/fail
gulp.task( "test-and-exit", function() {
return bg.testAllOnce();
} );
gulp.task( "default", [ "coverage", "coverage-watch" ], function() {} );
gulp.task( "specs", [ "continuous-specs", "specs-watch" ], function() {} );
gulp.task( "build", [ "test-and-exit" ] );
1.3.0
exclude
option to NYC command argsFAQs
Features and utilities to simplify advanced gulpfiles
We found that biggulp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.