\fBnpm-sbom\fR - Generate a Software Bill of Materials (SBOM)
.SS"Synopsis"
.P
.RS2
.nf
npm sbom
.fi
.RE
.SS"Description"
.P
The \fBnpm sbom\fR command generates a Software Bill of Materials (SBOM) listing the dependencies for the current project. SBOMs can be generated in either \fBSPDX\fR\fI\(lahttps://spdx.dev/\(ra\fR or \fBCycloneDX\fR\fI\(lahttps://cyclonedx.org/\(ra\fR format.
If package-lock-only is enabled, only the information in the package lock (or shrinkwrap) is loaded. This means that information from the package.json files of your dependencies will not be included in the result set (e.g. description, homepage, engines).
.SS"Configuration"
.SS"\fBomit\fR"
.RS0
.IP\(bu4
Default: 'dev' if the \fBNODE_ENV\fR environment variable is set to 'production', otherwise empty.
.IP\(bu4
Type: "dev", "optional", or "peer" (can be set multiple times)
.RE0
.P
Dependency types to omit from the installation tree on disk.
.P
Note that these dependencies \fIare\fR still resolved and added to the \fBpackage-lock.json\fR or \fBnpm-shrinkwrap.json\fR file. They are just not physically installed on disk.
.P
If a package type appears in both the \fB--include\fR and \fB--omit\fR lists, then it will be included.
.P
If the resulting omit list includes \fB'dev'\fR, then the \fBNODE_ENV\fR environment variable will be set to \fB'production'\fR for all lifecycle scripts.
.SS"\fBpackage-lock-only\fR"
.RS0
.IP\(bu4
Default: false
.IP\(bu4
Type: Boolean
.RE0
.P
If set to true, the current operation will only use the \fBpackage-lock.json\fR, ignoring \fBnode_modules\fR.
.P
For \fBupdate\fR this means only the \fBpackage-lock.json\fR will be updated, instead of checking \fBnode_modules\fR and downloading dependencies.
.P
For \fBlist\fR this means the output will be based on the tree described by the \fBpackage-lock.json\fR, rather than the contents of \fBnode_modules\fR.
The type of package described by the generated SBOM. For SPDX, this is the value for the \fBprimaryPackagePurpose\fR field. For CycloneDX, this is the value for the \fBtype\fR field.
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.
.P
Valid values for the \fBworkspace\fR config are either:
.RS0
.IP\(bu4
Workspace names
.IP\(bu4
Path to a workspace directory
.IP\(bu4
Path to a parent workspace directory (will result in selecting all workspaces within that folder)
.RE0
.P
When set for the \fBnpm init\fR 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.
.P
This value is not exported to the environment for child processes.
.SS"\fBworkspaces\fR"
.RS0
.IP\(bu4
Default: null
.IP\(bu4
Type: null or Boolean
.RE0
.P
Set to true to run the command in the context of \fBall\fR configured workspaces.
.P
Explicitly setting this to false will cause commands like \fBinstall\fR to ignore workspaces altogether. When not set explicitly:
.RS0
.IP\(bu4
Commands that operate on the \fBnode_modules\fR tree (install, update, etc.) will link workspaces into the \fBnode_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fIunless\fR one or more workspaces are specified in the \fBworkspace\fR config.
.RE0
.P
This value is not exported to the environment for child processes.