LinuxCommandLibrary

npm-pkg

manipulates package

TLDR

Get package.json field

$ npm pkg get [name]
copy
Set package.json field
$ npm pkg set [name]="[value]"
copy
Delete field
$ npm pkg delete [field]
copy
Get multiple fields
$ npm pkg get [name] [version]
copy
Set nested field
$ npm pkg set [scripts.test]="[jest]"
copy

SYNOPSIS

npm pkg [command] [options]

DESCRIPTION

npm pkg manipulates package.json fields. Read and write properties programmatically.
The command modifies package.json. Useful for scripts and automation.

PARAMETERS

COMMAND

Pkg subcommand.
get FIELD
Read field value.
set FIELD=VALUE
Write field value.
delete FIELD
Remove field.
--help
Display help information.

CAVEATS

Modifies package.json. Supports JSON paths. Use quotes for values.

HISTORY

npm pkg provides package.json manipulation from the command line.

SEE ALSO

npm(1), npm-init(1), npm-version(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community