MatteoGabriele / extract-package

Download and extract npm package versions :zap:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm version

extract-package

Download and extract npm package version

Requires

Node 6+

Install

$ npm install extract-package

Usage

const extractPackage = require('extract-package')

extractPackage({
  name: 'lodash'
}).then(response => {
  // path where package is downloaded
  console.log(response)
}).catch(error => {
  // oops!
})

Specify a version

extractPackage({
  name: 'lodash',
  version: '1.0.0'
})

Specify where to drop the package

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.

extractPackage({
  name: 'lodash',
  version: '1'
}, true)

About

Download and extract npm package versions :zap:


Languages

Language:JavaScript 100.0%