npm.io
3.1.12 • Published 8 years agoCLI

download-npm-package

Licence
MIT
Version
3.1.12
Deps
6
Vulns
0
Weekly
0
Stars
23

download-npm-package

Download a module from the npm registry.

Installation

npm [-g] install download-npm-package

Features

  • Library to download packages
  • CLI to download packages
  • Will use registry (and auth) defined in your .npmrc file
  • Supports scoped packages

Usage

node

downloadNpmPackage takes an package arg & a path as arguments and returns a promise, a promise that resolves once the package has been downloaded to the folder set in path.

import downloadNpmPackage from 'download-npm-package';

downloadNpmPackage({
  arg: 'modulname@version' // for example, npm@2 or @mic/version@latest etc
  dir: '/tmp' // package will be downlodaded to ${dir}/packageName
}).then()
cli

There's also a cli available!

download-npm-package $packageArg [$path]