Skip to main content

NPM Package Downloader

Project description

Download packages from NPM for private npm servers such as verdaccio and sinopia

  • Python 3.5+ only

Installation

Install using pip:

$ pip install npmdownloader

Usage

Downloading using the CLI:

$ python -m npmdownloader -f [PACKAGE_LIST] -o [DOWNLOAD_DIR] -c [NUM_OF_WORKER_PROCESS]

Downloading a package from code:

from npmdownloader import NpmPackageDownloader

downloader = NpmPackageDownloader('out_dir')
#Download package and get depedencies from tarball
#If the tarball already exists, the download will be skipped
package_info, was_downloaded = downloader.download_single('react', version='15.4.1')

#Extract information from the tarball package.json
package_json = package_info.get_package_json()

#Extract dependencies dictionary (package_name => version)
dependencies = package_info.get_dependencies()

Downloading multiple packages from code:

from npmdownloader import MultiPackageDownloader

downloader = MultiPackageDownloader('packages_list.txt', 'out_dir', workers_count=4)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

npmdownloader-1.0.0a2.tar.gz (4.6 kB view details)

Uploaded Source

File details

Details for the file npmdownloader-1.0.0a2.tar.gz.

File metadata

File hashes

Hashes for npmdownloader-1.0.0a2.tar.gz
Algorithm Hash digest
SHA256 dcf2058a0f1c277aa536b269f31584723ec573eecc07e9b634013276a5869c04
MD5 60c44905025efe081b205acc7803932d
BLAKE2b-256 54307cf7ad7bd12d7b5792cda1370b8ad2bb72b5c33237a86acc72189dc86c2f

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page