JSPM

add-dependencies

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1193
  • Score
    100M100P100Q119682F
  • License MIT

Add dependencies (latest or specified versions) to the package.json file without installing them

Package Exports

  • add-dependencies

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (add-dependencies) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

add-dependencies

This script adds dependencies (latest or specified versions) to the package.json file skipping the installation process.

Installing a dependency can have dangerous side effects, according to npm:

it is possible for a maliciously-written npm package, when installed, to execute a script.

It's safer and faster to add dependencies to package.json with this tool, and then only actually install them within a Docker container, for example, with docked-node.

Installation

If not using with npx (see below), you can install with:

$ npm install add-dependencies [-g]

Usage

Go to a directory with the target package.json and run:

$ add-dependencies <dependencies> [target] [--no-overwrite]

or with npx:

$ npx add-dependencies <dependencies> [target] [--no-overwrite]

where dependencies is the list of dependencies divided by space, and target is one of the following:

  • --dev / --save-dev / -D for devDependencies
  • --peer / --save-peer / -P for peerDependencies
  • --optional / --save-optional / -O for optionalDependencies

If no target argument passed, dependencies are written to dependencies.

Use --no-overwrite flag to prevent already existing packages in package.json from being overwritten.

Example:

$ add-dependencies moment@2.0.0 react@16.8 redux eslint --dev

or with npx:

$ npx add-dependencies moment@2.0.0 react@16.8 redux eslint --dev