Npm script
An npm script is a named command declared in a project's package.json file and runnable through npm.
Web Components in Action
npm scripts are named commands declared in package.json and executed through npm to automate project tasks.
- How it is used
- Automates project tasks and shortens repeatable build commands through package.json.
- How deep it goes
- Defines scripts, demonstrates npm run execution, and chains component builds, but stops short of general orchestration theory.
- Examples
- Uses echo, local Rollup commands, component-specific build scripts, and an aggregate script joined with &&.
- What you can do after
- Operate/configure named npm commands for individual component bundles and complete multi-component builds.
Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform
An npm script is a named command configuration in a project's package.json file that can be invoked through npm.
- How it is used
- Provides memorable project commands for starting microservices and running tests without exposing entry points or testing-tool details.
- How deep it goes
- Shows package.json entries and invocation commands for production, development, and testing, without examining npm’s execution internals.
- Examples
- Uses `npm start`, `npm run start:dev`, `npm test`, and `npm run test:watch` with matching package.json entries.
- What you can do after
- Operate/configure it by adding named package.json commands and invoking standard or custom scripts through npm.
Pro Angular 16
The scripts section is the package.json field containing named command definitions that a package manager can execute.
- How it is used
- Runs project-local development, build, watch, testing, and supporting commands through package.json.
- How deep it goes
- Defines command mappings and execution syntax, but does not detail npm’s script resolution internals.
- Examples
- Uses start, build, watch, test, and json scripts, including a json-server command serving restData.js on port 3500.
- What you can do after
- Operate/configure project tools through named npm commands executed from the package.json directory.
Essential TypeScript 5, Third Edition
The scripts section is the package.json configuration section that defines named commands runnable through npm.
- How it is used
- Centralizes repeatable compiler, server, bundler, build, test, and lint commands behind short npm invocations.
- How deep it goes
- Defines scripts through complete package.json examples and shows parallel execution, but does not detail npm script resolution internals.
- Examples
- Demonstrates tsc-watch, node dist/index.js, json-server, webpack serve, Angular CLI, and React scripts in package.json.
- What you can do after
- Operate development workflows with npm start and configure scripts that launch tools separately or in parallel.
Read how Essential TypeScript 5, Third Edition explains npm script →
Related concepts
- package.jsonpart of · package.json is the standard JSON manifest for an npm or Node.js package, declaring metadata, dependencies, scripts, entry points, and related configuration.
- npm start commandincludes · npm start is an npm command that runs the package manifest’s configured start script.
- toolchainconfigures · A toolchain is a coordinated collection of software tools that work together to develop, build, analyze, test, or deliver software.
- web serviceconfigures · A web service is a programmatic software interface that exposes functionality or data through web technologies or network protocols, typically HTTP.
- deployment pipelineuses · A sequence of automated or manual stages that builds, tests or validates, packages, and delivers software or models toward deployment.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.



