2019-11-05 14:55:08 -05:00
|
|
|
---
|
|
|
|
title: npm-pack
|
2020-11-01 07:54:36 +01:00
|
|
|
section: 1
|
2019-11-05 14:55:08 -05:00
|
|
|
description: Create a tarball from a package
|
|
|
|
---
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2019-11-05 14:55:08 -05:00
|
|
|
### Synopsis
|
|
|
|
|
|
|
|
```bash
|
|
|
|
npm pack [[<@scope>/]<pkg>...] [--dry-run]
|
|
|
|
```
|
|
|
|
|
|
|
|
### Description
|
2011-11-21 09:48:45 -08:00
|
|
|
|
|
|
|
For anything that's installable (that is, a package folder, tarball,
|
2020-12-11 18:54:56 -05:00
|
|
|
tarball url, git url, name@tag, name@version, name, or scoped name), this
|
|
|
|
command will fetch it to the cache, copy the tarball to the current working
|
|
|
|
directory as `<name>-<version>.tgz`, and then write the filenames out to
|
|
|
|
stdout.
|
2011-11-21 09:48:45 -08:00
|
|
|
|
|
|
|
If the same package is specified multiple times, then the file will be
|
|
|
|
overwritten the second time.
|
|
|
|
|
|
|
|
If no arguments are supplied, then npm packs the current package folder.
|
|
|
|
|
2018-08-29 12:03:09 -07:00
|
|
|
The `--dry-run` argument will do everything that pack usually does without
|
2020-12-11 18:54:56 -05:00
|
|
|
actually packing anything. That is, it reports on what would have gone
|
|
|
|
into the tarball, but nothing else.
|
2018-08-29 12:03:09 -07:00
|
|
|
|
2019-11-05 14:55:08 -05:00
|
|
|
### See Also
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2020-12-11 18:54:56 -05:00
|
|
|
* [npm-packlist package](http://npm.im/npm-packlist)
|
2020-11-01 07:54:36 +01:00
|
|
|
* [npm cache](/commands/npm-cache)
|
|
|
|
* [npm publish](/commands/npm-publish)
|
|
|
|
* [npm config](/commands/npm-config)
|
2019-11-05 14:55:08 -05:00
|
|
|
* [npmrc](/configuring-npm/npmrc)
|