npm set-script <script> <command>

Set tasks in the scripts section of package.json

Arguments

NameDescription
scriptName of the task to be added to the scripts section of package.json
commandCommand to run when script is called

Options

NameDescription
-w, --workspace <workspace...>Enable running a command in the context of the configured workspaces of the current project
-ws, --workspacesEnable running a command in the context of all the configured workspaces