Generate package.json files with dependency presets for React, Next.js, Express, testing, Tailwind, Prisma, and more. Includes script templates and version management.
package.json is the manifest file for Node.js projects and npm (Node Package Manager) packages. It defines the project's name, version, dependencies, scripts, entry points, and metadata. Every Node.js project — from simple scripts to complex web applications — starts with a package.json file.
This tool generates properly structured package.json files with common configurations for various project types, saving setup time and ensuring best practices are followed from the start.
| Field | Required | Purpose | Example |
|---|---|---|---|
| name | Yes | Package identifier (lowercase, no spaces) | "my-api-server" |
| version | Yes | Semantic version | "1.0.0" |
| description | No | Brief package description | "REST API for user management" |
| main | No | Entry point for CommonJS | "dist/index.js" |
| module | No | Entry point for ES modules | "dist/index.mjs" |
| scripts | No | Named command shortcuts | {"start": "node server.js"} |
| dependencies | No | Production packages | {"express": "^4.18.0"} |
| devDependencies | No | Development-only packages | {"jest": "^29.0.0"} |
| engines | No | Required Node.js/npm versions | {"node": ">=20.0.0"} |
| license | No | License identifier | "MIT" |
| type | No | Module system ("module" or "commonjs") | "module" |
dependencies are required to run your application in production. devDependencies are only needed during development (testing, building, linting). When deploying, you can skip devDependencies with npm install --production.
Use type module for ESM (import/export syntax) - recommended for new projects. Use type commonjs for traditional Node.js (require/module.exports). ESM is the modern standard with better tree-shaking and static analysis.
^ (caret) allows minor and patch updates: ^1.2.3 matches 1.x.x. ~ (tilde) allows only patch updates: ~1.2.3 matches 1.2.x. Exact versions (1.2.3) never auto-update. Use ^ for most packages, exact versions for critical dependencies.
Essential scripts: dev (development server), build (production build), start (run production), test (run tests), lint (run linter). Also consider: typecheck, format, preview, db:migrate for database projects.