1.1.0 • Published 7 years ago

gulp-install v1.1.0

Weekly downloads
25,666
License
MIT
Repository
github
Last release
7 years ago

gulp-install NPM version Build Status Dependency Status

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

File FoundCommand run
package.jsonnpm install
bower.jsonbower install
tsd.jsontsd reinstall --save
typings.jsontypings install
composer.jsoncomposer install
requirements.txtpip 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.

NOTE since v1.0.0 gulp-install requires at least NodeJS v6.

Primary objective

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

Installation

For global use with slush

Install gulp-install as a dependency:

npm install --save gulp-install

For local use with gulp

Install gulp-install as a development dependency:

npm install --save-dev gulp-install

Usage

In your slushfile.js:

var install = require("gulp-install");

gulp.src(__dirname + '/templates/**')
  .pipe(gulp.dest('./'))
  .pipe(install());

In your gulpfile.js:

var install = require("gulp-install");

gulp.src(['./bower.json', './package.json'])
  .pipe(install());

API

inject([options] [, callback])

ParamTypeDescription
optionsObjectAny option
callbackFunctionCalled when install is finished (not on failures)

Options

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

options.<command>

Type: Array|String|Object

Default: null

Use this option(s) to specify any arguments for any command, e.g:

var install = require("gulp-install");

gulp.src(__dirname + '/templates/**')
  .pipe(gulp.dest('./'))
  .pipe(install({
    npm: '--production', // Either a single argument as a string
    bower: {allowRoot: true}, // Or arguments as an object (transformed using Dargs: https://www.npmjs.com/package/dargs)
    pip: ['--target', '.'] // Or arguments as an array
  }));

options.commands

Type: Object

Default: null

Use this option to add any command to be run for any file, e.g:

var install = require("gulp-install");

gulp.src(__dirname + '/templates/**')
  .pipe(gulp.dest('./'))
  .pipe(install({
    commands: {
      'package.json': 'yarn'
    },
    yarn: ['--extra', '--args', '--here']
  }));

options.production

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}));  

options.ignoreScripts

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}));

options.noOptional

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}));

options.allowRoot

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}));  

options.args

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
    ));  

License

MIT License

accucode-wp-starterslush-hughes-wp-starterslush-accucode-wp-starterslush-slush-accucode-wp-startertheme_base_wordpressvisualcamp-automation@dudelkuchen/chartjs-plugin-largedatasetsslush-aws-samslush-phonegapslush-nodewebkit-express-nedbslush-boilerplateslush-nodewebkit-indexeddb@zrosenbauer/slush-reactorslush-reactorslush-wordpress-generatorgrommet-ocgrommet-phetaslush-api-blueprint-focus-boosterslush-ui5@avrora/avszoos-mp-service@infinitebrahmanuniverse/nolb-gulp-islush-new-componentslush-gulp-sassslush-gulpfile-front@everything-registry/sub-chunk-1808slush-ivomarsangcsjedge-launchpadelixir-npm-installoghlinerparcellonueva-funcionalidad-para-el-paquete-npm-merquililyconynuevo-libro-merquililyconymgt-gulpmobileformsphpacademyfirstpotionsellermerinomy-demonayrationgitbook-start-heroku-P8-josue-nayragitbook-start-heroku-P9-josue-nayragitbook-start-heroku-josue-nayragitbook-start-heroku-localstrategy-noejaco17gitbook-start-heroku-merquililyconygitbook-start-heroku-p7-josue-nayragitbook-start-heroku-token-oauth-noejaco17gitbook-start-https-noejacogitbook-start-plugin-iaas-ull-es-noejaco2017gitbook-start-proyectofinal-noejacogitbook-start-proyectofinal-noejaco17gitbook-start-team-noejaco2017-1.0gitbook-start-team-noejaco2017-2.0gitbook-start-team-noejaco2017-3.0gitbook-start-team-noejaco2017-4.0gitbook-start-iaas-ull-es-merquililyconygitbook-start-josue-nayragitbook-start-mongo-noejacogitbook-start-plugin-general-noejaco17gitbook-start-plugin-heroku-noejaco2017gitbook-start-digitalocean-merquililyconygulp-lightninggulp-dev-toolsgulp_buildheliosjshappn-protocolgreendirect-apigrommet-udacitygradprojectes6-gulp-boilerplateexpress-api-slushhsing-vuefe-gulpffalconfeds-build-scriptsglup-package-chameleonglup-package-lucasgenerator-azure-web-appgenerator-alloyteam-simplegenerator-package-xdcgenerator-package-cookinggenerator-package-cpinggladius-forgefoxtrel-command-installfoxtrel-commend-installjugsjugs-vuekoastlab_3_auctionlambduh-gulplambinatorliablitchi-mp-serviceliveblog-default-thememean-rmarkscript-initnetsells-gulppyi-clireqpack.models
1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.6.0

9 years ago

0.5.0

9 years ago

0.4.0

9 years ago

0.3.0

9 years ago

0.2.0

10 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.1

10 years ago