LinuxCommandLibrary

npm-run

TLDR

Run script from package.json

$ npm run [script-name]
copy
List available scripts
$ npm run
copy
Run with arguments
$ npm run [script] -- [--flag]
copy
Run silently
$ npm run [script] --silent
copy
Run if exists
$ npm run [script] --if-present
copy

SYNOPSIS

npm run [script] [-- args]

DESCRIPTION

npm run executes scripts defined in package.json. Core workflow command.
The command runs scripts section. Passes additional arguments after --.
npm run executes package scripts.

PARAMETERS

SCRIPT

Script name from package.json.
ARGS
Arguments to pass to script.
--silent
Suppress output.
--if-present
Don't fail if missing.
--help
Display help information.

CAVEATS

Scripts in package.json. Use -- for script args. Alias: npm run-script.

HISTORY

npm run is the primary mechanism for executing project-defined scripts.

SEE ALSO

npm(1), npm-start(1), npm-test(1)

Copied to clipboard