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, like npm start, npm stop, npm restart, npm test, and npm run, will still run their intended script even if ignore-scripts is 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 run
  • npm help scripts
  • npm help start
  • npm help restart
  • npm 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