0.2.0 • Published 9 years ago
download-package v0.2.0
download-package
Download the latest version of an npm package to a specified directory
Installation
npm install --save download-packageExample use
Here's how you would install the latest version of browserify into a packages folder:
const downloadPkg = require('download-package')
downloadPkg('browserify', `${__dirname}/packages`)
.then(() => console.log('do other stuff'))
.catch(() => console.log('there was an error downloading the package'))Notes for the above example:
- The destination folder (
./packages) must exist before runningdownloadPkg - The
browserifypackage files will be stored in./packages/browserify - The downloaded
browserifypackage can be 'required' like any other package:require('./packages/browserify')