Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kesla/download-npm-package
Download a module from the npm registry.
https://github.com/kesla/download-npm-package
Last synced: 28 days ago
JSON representation
Download a module from the npm registry.
- Host: GitHub
- URL: https://github.com/kesla/download-npm-package
- Owner: kesla
- License: other
- Created: 2016-07-02T16:15:12.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-09-01T06:27:15.000Z (over 3 years ago)
- Last Synced: 2024-08-09T21:26:56.976Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 419 KB
- Stars: 23
- Watchers: 1
- Forks: 3
- Open Issues: 9
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
- awesome-github-star - download-npm-package
README
# download-npm-package
Download a module from the npm registry.
## Installation
```shell
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.
```js
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!
```shell
download-npm-package $packageArg [$path]
```