NPM-RUN-SCRIPT(3)
π NAME π
npm-run-script β run arbitrary package scripts, bestie. that's it. that's the vibe. π
so like, this whole page lives in the npm-run-script(3) manual, and honestly? it's short, it's sweet, it slays. let's get into it. β¨
π¦ SYNOPSIS π¦
npm.commands.run-script(args, callback)
that's the whole signature. no cap. two things go in: args and callback. π
πΈ DESCRIPTION πΈ
okay so here's the tea: this thing runs an arbitrary command straight out of a package's "scripts" object. iconic behavior. π₯
it's the engine behind the test, start, restart, and stop commands β like, that's literally what those commands use under the hood β but you can also call it directly if you're feeling main character energy. π
now, the args parameter? it's an array of strings, and the way it behaves depends entirely on how many elements are in there. vibe check time:
- if there's only one element β npm assumes that element represents a command to be run on the local repository. one string, one job. easy. π«Ά
- if there's more than one element β then the first one is assumed to be the package, and the second one is assumed to be the command to run. first = package, second = command. got it? π
- all other elements β ignored. not invited to the party. π they're just... there. ignored. periodt. π
lowkey important: those extra elements don't error out or anything β they're just straight up ignored. don't come for me, that's what the page says. π
β SEE ALSO β
npm help 7 scriptsπnpm apihelp testπ§npm apihelp startπnpm apihelp restartπΈnpm apihelp stopπ
aaaand that's the whole page, bestie. not me being obsessed with how short this one is π go run some scripts, you've got this. π«Ά
sign-off: this was NPM-RUN-SCRIPT(3), dated March 2017 β yes, a vintage. she's an elder but she still ate. πβ¨
π¦ where this page comes from
- nixos 26.05: hueadm 1.2.1
- nixpkgs unstable: hueadm 1.2.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms