gulp-install

Automatically install npm, bower, tsd, and pip packages/dependencies if the relative configurations are found in the gulp file stream respectively

gulp-install

Automatically install npm, bower, tsd, and pip packages/dependencies if the relative configurations are found in the gulp file stream respectively

File Found Command run
package.json npm install
bower.json bower install
tsd.json tsd install
requirements.txt pip install -r requirements.txt

It will run the command in the directory it finds the file, so if you have configs nested in a lower directory than your slushfile.js/gulpfile.js, this will still work.

Used as the install step when using slush as a Yeoman replacement.

Install gulp-install as a dependency:

npm install --save gulp-install

Install gulp-install as a development dependency:

npm install --save-dev gulp-install
var install = require("gulp-install");
 
gulp.src(__dirname + '/templates/**')
  .pipe(gulp.dest('./'))
  .pipe(install());
var install = require("gulp-install");
 
gulp.src(['./bower.json', './package.json'])
  .pipe(install());

To not trigger the install use --skip-install as CLI parameter when running slush or gulp.

Type: Boolean

Default: false

Set to true if npm install should be appended with the --production parameter when stream contains package.json.

Example:

var install = require("gulp-install");
 
gulp.src(__dirname + '/templates/**')
  .pipe(gulp.dest('./'))
  .pipe(install({production: true}));  

Type: Boolean

Default: false

Set to true if npm install should be appended with the --ignore-scripts parameter when stream contains package.json. Useful for skipping postinstall scripts with npm.

Example:

var install = require("gulp-install");
 
gulp.src(__dirname + '/templates/**')
  .pipe(gulp.dest('./'))
  .pipe(install({ignoreScripts: true}));

Type: Boolean

Default: false

Set to true if npm install should be appended with the --no-optional parameter which will prevent optional dependencies from being installed.

Example:

var install = require("gulp-install");
 
gulp.src(__dirname + '/templates/**')
  .pipe(gulp.dest('./'))
  .pipe(install({noOptional: true}));

Type: Boolean

Default: false

Set to true if bower install should be appended with the --allow-root parameter when stream contains bower.json.

Example:

var install = require("gulp-install");
 
gulp.src(__dirname + '/templates/**')
  .pipe(gulp.dest('./'))
  .pipe(install({allowRoot: true}));  

Type: Array or String

Default: undefined

Specify additional arguments that will be passed to the install command(s).

Example:

var install = require("gulp-install");
 
gulp.src(__dirname + '/templates/**')
  .pipe(gulp.dest('./'))
  .pipe(install({
      args: ['dev', '--no-shrinkwrap' ]} // npm install --dev --no-shrinkwrap 
    ));  

MIT License