Socket
Socket
Sign inDemoInstall

download-package

Package Overview
Dependencies
82
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    download-package

Download a package from the npm registry into any folder


Version published
Weekly downloads
12
increased by140%
Maintainers
1
Install size
4.65 MB
Created
Weekly downloads
 

Readme

Source

download-package

Download the latest version of an npm package to a specified directory

Installation

    npm install --save download-package

Example 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 running downloadPkg
  • The browserify package files will be stored in ./packages/browserify
  • The downloaded browserify package can be 'required' like any other package: require('./packages/browserify')

Keywords

FAQs

Last updated on 27 Jun 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc