1NPM-PACK(1) NPM-PACK(1)
2
3
4
6 npm-pack - Create a tarball from a package
7
8 Synopsis
9 npm pack [[<@scope>/]<pkg>...] [--dry-run] [--json]
10
11 Configuration
12 <!-- AUTOGENERATED CONFIG DESCRIPTIONS START --> <!-- automatically
13 generated, do not edit manually --> <!-- see lib/utils/config/defini‐
14 tions.js -->
15
16 dry-run
17 • Default: false
18
19 • Type: Boolean
20
21
22 Indicates that you don't want npm to make any changes and that it
23 should only report what it would have done. This can be passed into any
24 of the commands that modify your local installation, eg, install, up‐
25 date, dedupe, uninstall, as well as pack and publish.
26
27 Note: This is NOT honored by other network related commands, eg
28 dist-tags, owner, etc. <!-- automatically generated, do not edit manu‐
29 ally --> <!-- see lib/utils/config/definitions.js -->
30
31
32 json
33 • Default: false
34
35 • Type: Boolean
36
37
38 Whether or not to output JSON data, rather than the normal output.
39
40 • In npm pkg set it enables parsing set values with JSON.parse() before
41 saving them to your package.json.
42
43
44 Not supported by all npm commands. <!-- automatically generated, do
45 not edit manually --> <!-- see lib/utils/config/definitions.js -->
46
47
48 pack-destination
49 • Default: "."
50
51 • Type: String
52
53
54 Directory in which npm pack will save tarballs. <!-- automatically
55 generated, do not edit manually --> <!-- see lib/utils/config/defini‐
56 tions.js -->
57
58
59 workspace
60 • Default:
61
62 • Type: String (can be set multiple times)
63
64
65 Enable running a command in the context of the configured workspaces of
66 the current project while filtering by running only the workspaces de‐
67 fined by this configuration option.
68
69 Valid values for the workspace config are either:
70
71 • Workspace names
72
73 • Path to a workspace directory
74
75 • Path to a parent workspace directory (will result in selecting all
76 workspaces within that folder)
77
78
79 When set for the npm init command, this may be set to the folder of a
80 workspace which does not yet exist, to create the folder and set it up
81 as a brand new workspace within the project.
82
83 This value is not exported to the environment for child processes.
84 <!-- automatically generated, do not edit manually --> <!-- see
85 lib/utils/config/definitions.js -->
86
87
88 workspaces
89 • Default: null
90
91 • Type: null or Boolean
92
93
94 Set to true to run the command in the context of all configured
95 workspaces.
96
97 Explicitly setting this to false will cause commands like install to
98 ignore workspaces altogether. When not set explicitly:
99
100 • Commands that operate on the node_modules tree (install, update,
101 etc.) will link workspaces into the node_modules folder. - Commands
102 that do other things (test, exec, publish, etc.) will operate on the
103 root project, unless one or more workspaces are specified in the
104 workspace config.
105
106
107 This value is not exported to the environment for child processes.
108 <!-- automatically generated, do not edit manually --> <!-- see
109 lib/utils/config/definitions.js -->
110
111
112 include-workspace-root
113 • Default: false
114
115 • Type: Boolean
116
117
118 Include the workspace root when workspaces are enabled for a command.
119
120 When false, specifying individual workspaces via the workspace config,
121 or all workspaces via the workspaces flag, will cause npm to operate
122 only on the specified workspaces, and not on the root project. <!--
123 automatically generated, do not edit manually --> <!-- see
124 lib/utils/config/definitions.js -->
125
126 <!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
127
128
129 Description
130 For anything that's installable (that is, a package folder, tarball,
131 tarball url, git url, name@tag, name@version, name, or scoped name),
132 this command will fetch it to the cache, copy the tarball to the cur‐
133 rent working directory as <name>-<version>.tgz, and then write the
134 filenames out to stdout.
135
136 If the same package is specified multiple times, then the file will be
137 overwritten the second time.
138
139 If no arguments are supplied, then npm packs the current package
140 folder.
141
142 See Also
143 • npm-packlist package http://npm.im/npm-packlist
144
145 • npm help cache
146
147 • npm help publish
148
149 • npm help config
150
151 • npm help npmrc
152
153
154
155
156 January 2022 NPM-PACK(1)