package.json generator

Answer a few questions and copy a well-formed package.json. The name and version are checked against the npm naming and semantic versioning rules, and you can pick a starter set of scripts for plain Node or TypeScript.

Lowercase, URL-safe, up to 214 characters. A scope is allowed: @scope/name.
Module type
Scripts
A semver range such as >=20. Leave empty to omit engines.
Separate with commas.
A URL or shorthand such as github:user/repo. Leave empty to omit.

Dependencies are not included: run npm install <package> to add them so the versions are real. Pick the license deliberately and add a matching LICENSE file.

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Enter the package name and version. Errors appear as soon as a value breaks the rules.
  2. Choose module type, entry file and a set of scripts.
  3. Add optional fields: description, keywords, author, license and repository.
  4. Copy the result into package.json, then run npm install for dependencies.

What is generated

Keys appear in a conventional order: name, version, description, private, type, main, scripts, engines, keywords, author, license, repository. Optional fields you leave empty are left out.

Example

The defaults give my-package 1.0.0 as an ES module with start and test scripts, engines.node set to >=20 and the MIT license.

Tips

  • Follow semantic versioning: increase the major number for breaking changes.
  • The test script from npm init fails on purpose until you replace it with a real test command.

Frequently asked questions

What makes a valid package name?

On npm, new names must be lowercase, 214 characters or fewer, URL-safe, and cannot start with a dot or underscore. A scoped name looks like @scope/name. The generator checks this before it produces output.

What does "type" do?

"module" makes .js files ES modules (import/export); "commonjs" keeps require(). Node reads it from the nearest package.json.

Why are there no dependencies?

Versions you type from memory are often wrong. Run npm install for each package, and npm writes the real versions for you.

What does private do?

With "private": true, npm will not publish the package, which protects an application or a work in progress from an accidental npm publish.

What is the engines field for?

It declares which Node versions the package supports, for example >=20. npm only warns about a mismatch unless engine-strict is enabled.

More in Developer

All tools in this category: Developer ·Updated November 3, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.