Don't like ads? Go Ad-Free Today

Package.json Generator

DataDeveloper
ADVERTISEMENT · REMOVE?
Lowercase, dashes/underscores; may be scoped (@scope/name).
Semantic version (MAJOR.MINOR.PATCH).
ESM sets type=module and uses .mjs entrypoints; CJS uses CommonJS.
Used for the main / module field.
Sets engines.node. Leave blank to omit.
Comma-separated.
Optional. Sets repository, bugs, and homepage.

Scripts

Dependencies

Use name@range syntax. Range defaults to latest if omitted.
Same syntax as above.

Output Options

ADVERTISEMENT · REMOVE?

Guide

Package.json Generator

Package.json Generator

Create a valid package.json from a structured form instead of memorizing every field. Set the package name, version, license, module system (ESM or CommonJS), Node engine, scripts, and dependencies, and the tool produces a clean, properly ordered manifest you can drop straight into a project.

Unlike a formatter that reshuffles an existing file, this generator builds the manifest from scratch and skips empty fields, so you get a minimal, publishable file that already follows the conventions npm uses for npm init.

How to Use

  1. Enter the package name, version, and (optional) description and author.
  2. Pick a license and choose ES Modules or CommonJS for the module system.
  3. Set the entry file (e.g. index.js) and an engines.node range like >=18.
  4. Fill in the scripts you actually use (dev, build, test, start) — leave fields blank to omit them.
  5. Add dependencies and devDependencies as name@range, one per line or comma-separated.
  6. Choose your indent (2 spaces, 4 spaces, or tab) and copy or download the generated package.json.

Features

  • Form-driven – No need to remember the exact field names or order; common keys are filled in for you.
  • ESM or CommonJS – Toggle the module system and the tool sets "type": "module" and the module entry accordingly.
  • Smart scripts – Empty script fields are dropped instead of left as "" placeholders.
  • Dependency parsing – Paste a list of package@^1.2.3 entries and they become a tidy dependencies object.
  • Repository helpers – Drop in a GitHub URL and the generator fills repository, bugs, and homepage for you.
  • Private flag – One click marks the package as private to prevent an accidental npm publish.
  • Indent your way – Output as 2 spaces, 4 spaces, or tab to match your repo’s existing style.
  • Copy or download – Grab the result as text or download package.json directly.

ADVERTISEMENT · REMOVE?

FAQ

  1. What is the difference between dependencies and devDependencies?

    dependencies are packages your code imports at runtime and that consumers of your package will also install. devDependencies are tools you only need while developing or building the project — bundlers, test runners, type checkers — and they are not installed when someone adds your package to their own project.

  2. What does setting type to module actually do?

    Setting "type": "module" tells Node.js to treat .js files in the package as ES modules, so import and export work natively. Without it, Node treats .js as CommonJS and you have to use require/module.exports. ES Modules also enable top-level await and stricter file resolution.

  3. Why does package.json use semantic versioning?

    Semantic versioning (MAJOR.MINOR.PATCH) gives consumers a contract: a PATCH bump should be a safe bug fix, MINOR adds backward-compatible features, and MAJOR signals breaking changes. Range operators like ^ and ~ rely on this contract so npm can install compatible updates without breaking your build.

  4. What is the engines field for?

    The engines field declares which Node.js (or other runtime) versions your package supports. npm and many tools surface a warning when an installer is on an unsupported version, and some platforms refuse to install at all. Setting an explicit node range prevents subtle bugs caused by APIs that exist on newer Node versions.

Want To enjoy an ad-free experience? Go Ad-Free Today

Install Our Extensions

Add IO tools to your favorite browser for instant access and faster searching

Add to Chrome Extension Add to Edge Extension Add to Firefox Extension Add to Opera Extension

Scoreboard Has Arrived!

Scoreboard is a fun way to keep track of your games, all data is stored in your browser. More features are coming soon!

ADVERTISEMENT · REMOVE?
ADVERTISEMENT · REMOVE?
ADVERTISEMENT · REMOVE?

News Corner w/ Tech Highlights

Get Involved

Help us continue providing valuable free tools

Buy me a coffee
ADVERTISEMENT · REMOVE?