package.json Generator
Build a complete, production-ready package.json — not just name and version. Pick a framework preset to wire in idiomatic scripts and dependencies, set the module type, exports map, bin entries, engines and packageManager, then watch a live npm-rules validator flag invalid names, bad semver, duplicate deps, and missing fields as you type.
About this ToolHow it works, benefits & use casesTap to collapse
Most package.json generators stop at name, version, and a license dropdown. This one builds the whole manifest the way a real project ships it. Start from a framework preset -- Node library, React + Vite, Next.js, Express API, Vue + Vite, or CLI tool -- and it merges in idiomatic scripts, runtime dependencies, and dev tooling, then sets a sensible module type, entry points, and engines range. From there you control everything: the ESM-vs-CommonJS type, a modern exports map built from your types/module/main fields, bin entries that turn the package into a CLI, a files publish allowlist, engines.node and packageManager, keywords, repository/homepage/bugs links, and full editors for scripts, dependencies, and devDependencies. The package.json renders live with keys in the conventional order and every empty field omitted, while a built-in validator checks it against npm's own rules -- invalid names, bad semver, dependencies duplicated across deps and devDeps, a main file your files allowlist would exclude, and missing description/license/engines -- so you copy a manifest that installs cleanly the first time. Output can be copied, downloaded as package.json, shared via URL, or piped into another tool.
How to Use
- 1Pick a framework preset to merge in matching scripts and dependencies, or skip it and build from scratch.
- 2Set the identity fields: name (validated against npm rules as you type), version, description, author, license, and keywords.
- 3Choose the module type (ESM or CommonJS), fill in main/module/types, and toggle the exports map on if you want a modern entry-point block.
- 4Add bin entries, a files allowlist, engines.node, and packageManager as needed; edit scripts and dependencies with the add/remove rows.
- 5Watch the live package.json and the validation panel, then copy, download, share, or pipe the result.
Key Benefits
- Six framework presets that contribute real scripts, dependencies, dev tooling, type, and engines
- Full control of modern fields: type, exports map, bin, files allowlist, engines, and packageManager
- Live npm-rules validator flags invalid names, bad semver, duplicate deps, and excluded entry files
- Keys emitted in conventional order with every empty field omitted for a clean manifest
- Scripts, dependencies, and devDependencies edited as add/remove rows with quick-add from the active preset
- Shareable URL captures the entire manifest state for reproducible links
- Copy, download as package.json, or pipe the output to another tool
Common Use Cases
- Scaffolding a publishable npm library with the right exports map, types, and files allowlist
- Turning a project into a CLI by adding a bin entry without memorizing the syntax
- Generating the standard Next.js, React + Vite, or Vue script block in one click
- Catching a duplicate dependency or an invalid package name before the first npm install
- Setting engines.node and packageManager to pin the toolchain for a team
- Teaching newcomers what every field in a modern package.json actually does
Updates live as you edit — keys in conventional order, empty fields omitted
{
"name": "my-package",
"version": "1.0.0",
"license": "MIT",
"type": "module",
"main": "index.js",
"engines": {
"node": ">=18"
}
}description· Add a description — it shows in npm search results.
Framework preset
Pick a preset to merge in idiomatic scripts and dependencies, or build from scratch below.
Identity
Lowercase, url-safe; @scope/name allowed
Module & entry points
Adds an "exports": { ".": { … } } block built from types / module / main.
None yet.
None — the whole package directory is published.
Scripts
None yet.
Dependencies
None yet.
None yet.
More than name and version
A real package.json carries the metadata that npm, your bundler, and your editor all read: the module type, an exports map that controls what consumers can import, bin entries that turn your package into a CLI, an engines range that warns on the wrong Node, and a filesallowlist that keeps your published tarball lean. This generator gives you all of them and validates the result against npm's own rules.
Why the validator matters
npm rejects names that are uppercase, contain spaces, or start with a dot or underscore, and it expects a valid semver version. Listing the same dependency in both dependencies and devDependencies is a common foot-gun. The live audit on the left flags these the moment they appear, so you copy a manifest that installs cleanly the first time.
Was this tool helpful?
Share Your Experience
Help others discover this tool!
Related tools
- Package.json Scripts GeneratorGenerate common npm scripts for different project types and workflows
- Node Version Manager HelperGenerate .nvmrc, package.json engines field, and Node.js version files
- Package.json Dependency UpdaterAnalyze and update package.json dependencies with version strategies
- JSON FormatterFormat and validate JSON with syntax highlighting
- JSON ValidatorValidate JSON syntax and structure
- Browserslist GeneratorGenerate browserslist configurations
A preset merges a contribution on top of your current model. Node library adds tsup/vitest dev tooling, an ESM build, and dist entry points; React + Vite and Vue + Vite add vite dev/build/preview scripts plus the framework runtime; Next.js adds next dev/build/start/lint with next, react, and react-dom; Express API switches to CommonJS with node/nodemon/jest and express; CLI tool adds a bin entry, a tsup build, and cac. Your existing fields are preserved -- presets do not clobber dependencies you already added.
A live audit checks the manifest against npm rules: the name must be lowercase, url-safe, under 214 characters, and not start with a dot or underscore (scoped @scope/name is allowed); the version must be valid semver; the same package must not appear in both dependencies and devDependencies; and if a files allowlist is set, your main entry must be included in it. It also nudges you with info/warning notes for a missing description, license, or engines.node.

