npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gulp-install

v1.1.0

Published

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

Downloads

74,765

Readme

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 Found | Command run|
| --- | --- |
|package.json | npm install|
|bower.json | bower install|
|tsd.json | tsd reinstall --save|
|typings.json | typings install|
|composer.json | composer 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.

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

| Param | Type | Description | | --- | --- | --- | | options | Object | Any option | | callback | Function | Called 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