NPM-TEST(1)
π NAME π
npm-test β test a package, bestie. That's it, that's the whole vibe β¨
(this one's from the npm-test manual, page 1, and it's gonna be so good for you)
π¦ Synopsis π¦
npm test [-- <args>]
aliases: tst, t π«Ά (yes, you can just type npm t like a person in a hurry, iykyk)
πΈ Description πΈ
Okay so here's the tea β: this runs a predefined command that lives in the "test" property of your package's "scripts" object. That's the whole thing. You're not inventing anything new, you're just telling npm "hey, run the thing I already wrote down" and npm goes and does it. iconic behavior honestly π
π Example π
Like, say your package.json looks like this:
{
"scripts": {
"test": "node test.js"
}
}
Then you hit it with:
npm test
> npm@x.x.x test
> node test.js
(test.js output would be here)
and boom, your script runs, the output shows up where it says (test.js output would be here). slay π
β¨ Configuration β¨
π ignore-scripts
- Default:
false - Type: Boolean
If it's true, npm does not run scripts specified in package.json files. no cap, it just refuses π
β οΈ But listen β commands that are explicitly meant to run a particular script, likenpm start,npm stop,npm restart,npm test, andnpm run, will still run their intended script even ifignore-scriptsis set. The catch? They won't run any pre- or post-scripts. So no sneaky before/after business, bestie π
Setting ignore-scripts also disables .npm-extension execution, as if ignore-extension were set. yep, package said no extensions, so no extensions π«
π§ script-shell
- Default:
'/bin/sh'on POSIX systems,'cmd.exe'on Windows - Type: null or String
This is the shell to use for scripts run with the npm exec, npm run and npm init <package-spec> commands. it's giving "choose your fighter" but for shells π
π See Also π
npm help runnpm help scriptsnpm help startnpm help restartnpm help stop
and that's the page!! go test your package bestie, you're gonna eat π₯
signing off with the official receipts: this was NPM@12.2.1, dated October 2026, and the page is NPM-TEST(1) β periodt π
π¦ where this page comes from
- arch rolling: npm 12.2.1-1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms