"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/npm/lib/fetch-package-metadata.md" (7 Feb 2017, 1807 Bytes) of archive /windows/misc/atom-windows.zip:

As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.


var fetchPackageMetadata = require("npm/lib/fetch-package-metadata")
fetchPackageMetadata(spec, contextdir, callback)

This will get package metadata (and if possible, ONLY package metadata) for a specifer as passed to npm install et al, eg npm@next or npm@^2.0.3

fetchPackageMetadata(spec, contextdir, tracker, callback)

In the case of tarballs and git repos, it will use the cache to download them in order to get the package metadata. For named packages, only the metadata is downloaded (eg http://registry.npmjs.org/package). For local directories, the package.json is read directly. For local tarballs, the tarball is streamed in memory and just the package.json is extracted from it. (Due to the nature of tars, having the package.json early in the file will result in it being loaded faster– the extractor short-circuits the uncompress/untar streams as best as it can.)