Skip to main content

read

Function read 

Source
pub fn read(bytes: &[u8], limits: &Limits) -> Result<Package, PackageError>
Expand description

Reads a package tarball, gzipped (.tgz, as registries serve them) or not.

The package folder is wherever package.json sits nearest the top, so a tarball made from any folder works, not only npm’s package/. Only the JSON files directly in that folder and in its example folder are kept.

§Errors

When the archive is unreadable, breaks limits, or has no package.json.