Skip to content

Install multiple versions of a node module to versioned or custom directories.

License

Notifications You must be signed in to change notification settings

scott-lin/install-npm-version

Repository files navigation

install-npm-version

npm-version

Install multiple versions of a node module to versioned or custom directories.

Command Line Usage

Install

npm install -g install-npm-version

How To

Syntax:

  inv <package> [options...]
  install-npm-version <package> [options...]

Required:

  package
    Package to be installed, which is passed through to "npm install <package>".

Optional:

  --destination, --d
    Directory path relative to node_modules/ of the [working-directory] to install package to.
    Default: sanitized <package>

  --overwrite, --o
    Overwrite any existing package at [destination] location.
    Default: false

  --silent, --s
    Suppress informational messages, but error messages will still be shown.
    Default: false

  --debug
    Shows detailed messages about execution process.
    Default: false

  --working-directory, --wd
    Directory that contains node_modules/ folder to install package to. If no node_modules/ folder exists, one will be created.
    Default: current directory

  --useLocalNpmConfig
    Uses any existing NPM configuration within [working-directory] when installing package.

  --help, --h
    Shows these how-to instructions.

Examples

> inv [email protected]
# installs [email protected] to node_modules/[email protected]/

> inv [email protected] --destination some/path/chalk
# installs [email protected] to node_modules/some/path/chalk/

Programmatic Usage

Install

npm install install-npm-version --save-dev

Examples

Install to versioned (default) directory

import inv = require('install-npm-version');

inv.Install('[email protected]');
// installs [email protected] to node_modules/[email protected]/

inv.Install('[email protected]');
// installs [email protected] to node_modules/[email protected]/

Install to custom directory

import inv = require('install-npm-version');

inv.Install('[email protected]', { 'Destination': 'some/path/chalk' });
// installs [email protected] to node_modules/some/path/chalk/

Install with silent or noisy standard output

import inv = require('install-npm-version');

inv.Install('[email protected]', { 'Verbosity': 'Silent' });
inv.Install('[email protected]', { 'Verbosity': 'Debug' });

Overwrite an existing installation

import inv = require('install-npm-version');

inv.Install('[email protected]', { 'Destination': 'mydir' });
// installs [email protected] to node_modules/mydir/

inv.Install('[email protected]', { 'Destination': 'mydir' });
// does not install [email protected] since node_modules/mydir/ already exists

inv.Install('[email protected]', { 'Destination': 'mydir', 'Overwrite': true });
// installs [email protected] to node_modules/mydir/ by overwriting existing install

About

Install multiple versions of a node module to versioned or custom directories.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published