Visually Create npm Project Configuration Β· One-Click Copy JSON
Lowercase letters, hyphens and underscores, e.g. my-project
One per line, format: package@version (e.g. express@^4.18.0)
package.json is the core configuration file for Node.js projects, containing metadata such as project name, version, dependencies, and scripts. Every npm package and Node.js project requires a package.json file. It serves as the foundation of the npm ecosystem for managing dependencies and defining scripts.
The scripts field defines commands that can be executed via npm run. Common scripts include start (launch app), test (run tests), and build (build project). npm automatically adds node_modules/.bin to the PATH when running scripts.
dependencies are required at runtime in production (e.g., Express, Lodash). devDependencies are only needed during development (e.g., Jest for testing, Webpack for building, ESLint for linting). Use npm install --save-dev for dev dependencies.
Use npm init for an interactive setup, or npm init -y to generate default config quickly. You can also use this tool to visually configure all fields, then copy or download the generated package.json to your project root.