node/deps/npm/node_modules/libnpmpack
npm CLI robot 687e50aded
deps: upgrade npm to 8.13.1
PR-URL: https://github.com/nodejs/node/pull/43552
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2022-06-25 02:21:50 +01:00
..
lib deps: upgrade npm to 8.5.2 2022-02-26 08:15:26 +01:00
LICENSE deps: update npm to 7.0.0-rc.3 2020-10-07 09:59:49 -04:00
package.json deps: upgrade npm to 8.13.1 2022-06-25 02:21:50 +01:00
README.md deps: upgrade npm to 8.7.0 2022-04-17 07:27:48 +02:00

libnpmpack

npm version license CI - libnpmpack

libnpmpack is a Node.js library for programmatically packing tarballs from a local directory or from a registry or github spec. If packing from a local source, libnpmpack will also run the prepack and postpack lifecycles.

Table of Contents

Example

const pack = require('libnpmpack')

Install

$ npm install libnpmpack

API

> pack(spec, [opts]) -> Promise

Packs a tarball from a local directory or from a registry or github spec and returns a Promise that resolves to the tarball data Buffer, with from, resolved, and integrity fields attached.

If no options are passed, the tarball file will be saved on the same directory from which pack was called in.

libnpmpack uses pacote. Most options are passed through directly to that library, so please refer to its own opts documentation for options that can be passed in.

Examples
// packs from cwd
const tarball = await pack()

// packs from a local directory
const localTar = await pack('/Users/claudiahdz/projects/my-cool-pkg')

// packs from a registry spec
const registryTar = await pack('abbrev@1.0.3')

// packs from a github spec
const githubTar = await pack('isaacs/rimraf#PR-192')