package.json Generator
Generate a valid package.json for Node.js and npm projects.
Loading tool...
What is package.json Generator?
The package.json Generator is a browser-based tool that builds a valid npm manifest from a simple form. It covers the basics (name, version, description, license), entry points (main, module, types, bin, files), scripts, dependencies, devDependencies, engines, and repository fields β with live validation and a real-time JSON preview.
Key Benefits
- No syntax errors from hand-editing JSON
- Validates npm naming rules and semver live
- Fields ordered the way npm expects
- Works offline, nothing uploaded
Common Use Cases
- β’Scaffolding a new Node.js library or CLI
- β’Converting a project from CommonJS to ESM
- β’Documenting engines and scripts for a team
- β’Preparing an open-source package for publish
How to Generate a package.json
- Fill in the Basics: Enter the package name, version, description, license, module type (ESM or CommonJS), and whether the package is private.
- Set Entry Points: Optionally add main, module, types, bin, and the files allowlist that controls what gets published to npm.
- Add Scripts and Dependencies: Create npm scripts like start, build, and test, then list dependencies and devDependencies with their version ranges.
- Add Repository and Engines: Point to your Git repository and declare the minimum Node.js and npm versions your package requires.
- Copy or Download: Review the live JSON preview, then copy it to your clipboard or download it as package.json into your project.
Key Features
- Complete Field Coverage: Build every common field: name, version, description, main, module, types, bin, files, type, scripts, dependencies, devDependencies, engines, repository, license, and private.
- Live Name and Version Validation: The package name is checked against npm naming rules and the version against semver as you type, with clear inline warnings.
- Dynamic Script and Dependency Rows: Add, edit, and remove scripts and dependencies in a table-like editor instead of hand-editing JSON.
- Live JSON Preview: The generated package.json updates on every keystroke, with fields emitted in conventional npm order.
- Copy or Download: Copy the manifest to your clipboard or download it as a ready-to-use package.json file.
- Fully Offline: Everything runs in your browser. No data is uploaded to any server.