Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matteogabriele/extract-package
Download and extract npm package versions :zap:
https://github.com/matteogabriele/extract-package
download extract npm package tarball
Last synced: 23 days ago
JSON representation
Download and extract npm package versions :zap:
- Host: GitHub
- URL: https://github.com/matteogabriele/extract-package
- Owner: MatteoGabriele
- Created: 2017-05-07T21:08:55.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-06T22:24:12.000Z (about 2 years ago)
- Last Synced: 2024-04-14T21:51:53.157Z (9 months ago)
- Topics: download, extract, npm, package, tarball
- Language: JavaScript
- Homepage:
- Size: 277 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![npm version](https://badge.fury.io/js/extract-package.svg)](https://badge.fury.io/js/extract-package)
# extract-package
Download and extract npm package version
## Requires
Node 6+
## Install
```bash
$ npm install extract-package
```## Usage
```js
const extractPackage = require('extract-package')extractPackage({
name: 'lodash'
}).then(response => {
// path where package is downloaded
console.log(response)
}).catch(error => {
// oops!
})
```### Specify a version
```js
extractPackage({
name: 'lodash',
version: '1.0.0'
})
```### Specify where to drop the package
```js
extractPackage({
name: 'lodash',
version: '1.0.0',
dest: '/path/to/folder'
})
```### Satisfy major versions
Assuming that the package version are 1.4.5, 1.6.5 and 2.0.0, this example will download the version 1.6.5, which is the latest version that satisfies that major version.
```js
extractPackage({
name: 'lodash',
version: '1'
}, true)
```