NPM Script

Noun · Development

Definitions

  1. A shell command defined in the `scripts` field of a project's package.json that can be executed via `npm run <name>`. Lifecycle scripts like `preinstall`, `build`, and `test` run automatically at specific points, while custom scripts serve as a lightweight task runner.

    In plain English: A shortcut command defined in your project's configuration that bundles up common tasks like building, testing, or starting the app.

    Example: "Just run `npm run dev` — the script starts the Vite server, the API mock, and opens the browser all at once."

Related Terms