NPM-PACK(1)
π
NPM-PACK(1) β the npm-pack glow-up
Okay bestie, welcome to the manual page for npm-pack, aka the little command that turns your whole package into a single cute lil tarball. This is the NPM-PACK(1) page and yes, we're reading it together, it's gonna be fun, I promise π«Ά
β¨ NAME β¨
npm-pack β Create a tarball from a package
πΈ Synopsis πΈ
npm pack <package-spec>
π Configuration π
These are the config knobs that change how pack behaves. Read them, love them, set them in your npmrc if that's your vibe π
dry-run
- Default:
false - Type: Boolean
This one is the "look but don't touch" of the config world π Setting it means you don't want npm to actually make any changes β it should just report what it would have done. Very demure, very mindful.
You can pass this into any of the commands that modify your local installation, eg, install, update, dedupe, uninstall, as well as pack and publish.
Note: this is NOT honored by other network related commands, egdist-tags,owner, etc. So don't come crying to me when it doesn't work there π
json
- Default:
false - Type: Boolean
Whether or not to output JSON data, rather than the normal output. Machine-readable slay π₯
- In
npm pkg setit enables parsing set values withJSON.parse()before saving them to yourpackage.json.
Not supported by all npm commands. So like, check before you assume, bestie π
pack-destination
- Default:
"." - Type: String
Directory in which npm pack will save tarballs. That's it, that's the whole thing β it's where the .tgz files land. Default is literally just the current directory, iconic behavior β¨
workspace
- Default:
- Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the current project, while filtering by running only the workspaces defined by this configuration option. Monorepo girlies, this one's for you π
Valid values for the workspace config are either:
- Workspace names
- Path to a workspace directory
- Path to a parent workspace directory (will result in selecting all workspaces within that folder)
When set for the npm init command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project. New workspace glow-up, we love to see it π±
This value is not exported to the environment for child processes.
workspaces
- Default:
null - Type: null or Boolean
Set to true to run the command in the context of all configured workspaces. All of them. Every single one. Family reunion π
Explicitly setting this to false will cause commands like install to ignore workspaces altogether. When not set explicitly:
- Commands that operate on the
node_modulestree (install,update, etc.) will link workspaces into thenode_modulesfolder. - Commands that do other things (
test,exec,publish, etc.) will operate on the root project, unless one or more workspaces are specified in theworkspaceconfig.
This value is not exported to the environment for child processes.
include-workspace-root
- Default:
false - Type: Boolean
Include the workspace root when workspaces are enabled for a command. Basically: do we invite the parent to the party or not π₯³
When false, specifying individual workspaces via the workspace config, or all workspaces via the workspaces flag, will cause npm to operate only on the specified workspaces, and not on the root project. Sorry root, you're not on the list tonight π
This value is not exported to the environment for child processes.
ignore-scripts
- Default:
false - Type: Boolean
If true, npm does not run scripts specified in package.json files. No pre, no post, no nothing. Silence π€«
Note that commands explicitly intended to run a particular script β such asnpm start,npm stop,npm restart,npm test, andnpm runβ will still run their intended script ifignore-scriptsis set, but they will not run any pre- or post-scripts. So the main character script still shows up, just without its entourage.
Setting ignore-scripts also disables .npm-extension execution, as if ignore-extension were set. Package those two together, they're a matching set π
π¦ Description π¦
For anything that's installable (that is, a package folder, tarball, 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. So you get the file and a little receipt on your terminal, we stan transparency β¨
If the same package is specified multiple times, then the file will be overwritten the second time. Yes, overwritten. No merge, no drama, just replacement π
If no arguments are supplied, then npm packs the current package folder. Very "I'll just do it myself then" of it, honestly π«Ά
π See Also π
npm help "package spec"npm-packlistpackage β¨http://npm.im/npm-packlistβ©npm help cachenpm help publishnpm help confignpm help npmrc
And that's the whole page, bestie β you ate that reading session fr fr π This was npm-pack from NPM@12.2.1, dated October 2026. Go pack something iconic πβ¨π¦
π¦ where this page comes from
- arch rolling: npm 12.2.1-1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms