Skip to content

Menu

package.json Generator

Generate package.json files interactively with scripts and metadata.

Runs entirely in your browserDevOpsFree, no sign-up
Loading tool

01What is package.json Generator?

Running npm init and answering prompts is fine, but you often want to see the whole file while you decide. This generator builds a starter package.json from a short form and updates the JSON as you type. You set Name, Version, Main, License, Description and Author. The license list holds MIT, Apache-2.0, GPL-3.0, BSD-3-Clause, ISC and UNLICENSED. The first five are SPDX identifiers, and UNLICENSED is the value npm's docs suggest when you don't want to grant any rights. Tick the ES Module box and "type": "module" is added, which tells Node to treat .js files as ES modules. Scripts are name and command pairs. You can edit the two default rows (dev and test), add rows with + Add script, or remove one with the x button. Rows with an empty name are skipped. Empty Description, Author and Main fields are left out of the output rather than written as empty strings. The fields come out in a fixed order: name, version, description, main, type, scripts, author, license. The checks are where it helps most. The name is tested against the rules in npm's package.json documentation. It must be 214 characters or fewer including the scope, contain no uppercase letters and be URL-safe. An unscoped name can't start with a dot or an underscore. A name that starts with @ must look like @scope/package. URL safety is checked by running each part through encodeURIComponent and seeing whether it changes. The version is tested against the official grammar from Semantic Versioning 2.0.0. Any problem appears as a warning just under the first row of fields. A worked example: type My-Project as the name and you'll see "Name must not contain uppercase letters." Change it to my-project and the warning goes away. Set the version to v1.2.3 and you get a semver warning, since the v prefix isn't part of the spec. 1.2.3-beta.1 and 2.1.0+build.5 both pass. Warnings don't block anything. The JSON still updates, so it's on you to clear them before you publish. Some limits are worth knowing. The tool doesn't write dependencies, devDependencies, exports, files, types, engines, repository, private or workspaces. Add those by hand, or let npm install fill in dependencies. It doesn't check whether a name is already taken on the npm registry. It also skips npm's other name rules, such as blocking Node core module names. Treat it as a quick starting point, then run npm publish --dry-run before a real release.

Node.js developers starting a new project who want a valid package.json, with name and semver checks, without walking through npm init. The tool runs entirely in your browser, so your data never leaves your device.

02How to use package.json Generator

  1. Enter the Name and Version and fix any warnings that appear below them.
  2. Set Main, pick a License and add a Description and Author if you want them.
  3. Tick ES Module if your .js files use import and export.
  4. Edit the Scripts rows, use + Add script for more, or remove a row with x.
  5. Click the copy icon on the JSON preview and paste it into package.json.

03Worked examples

Input: Name: My-Project
Result: Name must not contain uppercase letters.
Input: Name: @acme/utils
Result: No problems
Scoped names are allowed in the form @scope/package.
Input: Name: @acme
Result: Scoped names look like @scope/package.
Input: Name: _private
Result: Unscoped names can't start with a dot or underscore.
Input: Name: my project
Result: Name contains characters that aren't URL-safe.
A space is not URL-safe; use a hyphen instead.
Input: Versions: 1.0 / 01.0.0 / v1.2.3 / 1.0.0-beta.1 / 2.1.0+build.5
Result: invalid / invalid / invalid / valid / valid
Semver needs three numbers with no leading zeros and no 'v' prefix; pre-release (-beta.1) and build (+build.5) suffixes are allowed.

04Common use cases

  • Starting a small Node.js script or CLI project without running npm init
  • Setting up an ES module project with "type": "module" from the start
  • Checking that a package name follows npm's naming rules before you claim it
  • Drafting the scripts block (dev, build, test) for a new repository
  • Checking whether a version string like v1.2.3 or 1.0 is valid semver before tagging a release
  • Giving a teammate a clean package.json for a demo or workshop repo

05Tips

  • Use UNLICENSED for private code you don't want others to use, and add "private": true by hand so npm refuses to publish it by accident.
  • npm's docs say main defaults to index.js in the package root, so you can clear Main if that's your entry file.
  • For a library, consider adding an exports field by hand. npm describes it as a modern alternative to main that can define several entry points.
  • The engines field is advisory. npm only warns about a mismatched Node version unless engine-strict is set.
  • A name passing here can still be taken. Check the registry with npm view <name> before you publish.

06Related concepts

npm, Semantic versioning, ES modules, SPDX license identifiers.

Frequently Asked Questions

What is package.json Generator?

package.json Generator is a free, browser-based developer tool on AIDToolStack. Generate package.json files interactively with scripts and metadata. It requires no installation or sign-up and works entirely in your browser.

Is package.json Generator free to use?

Yes. No sign-up, no fees and no usage cap.

Does package.json Generator store my data?

No. It runs in your browser; nothing is uploaded.

Cheat sheet

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe