package.json Generator — Create a Node.js package.json

Fill in a form and get a valid package.json — npm name validation, script presets for Vite, Next.js, Node and TypeScript libraries, exports, engines, license and repository — with warnings for common mistakes.

Runs in your browser
package.json

    Your data never leaves your computer. All processing happens 100% locally in your browser.

    How to use the package.json Generator

    1. Enter the package name and version — the name is checked against npm’s naming rules as you type.
    2. Choose a scripts preset (Node, Vite, Next.js, TypeScript library) and the module type.
    3. Add license, author, repository and the Node.js version your code needs.
    4. Copy or download the file into your project root, then run npm install to add dependencies.

    The most important package.json fields

    FieldWhat it does
    namePackage name — lowercase, max. 214 characters, URL-safe, may be scoped (@org/name)
    versionA semantic version like 1.4.2
    type"module" treats .js files as ES modules (import); default is CommonJS
    main / exportsThe entry point(s) other code imports. exports also hides internal files
    scriptsCommands for npm run dev, build, test…
    enginesNode.js versions your code supports
    privatetrue prevents accidental npm publish
    packageManagerPins npm, pnpm or Yarn via Corepack

    Dependencies are added by the package manager

    Don’t type dependency versions by hand — run npm install react or npm install -D vite and npm writes them with the right version range (usually ^). Commit the lock file so everyone installs the same versions.

    Next steps for a new project

    Add a .gitignore (at least node_modules/ and .env), an .editorconfig, a README and a GitHub Actions workflow that runs your test and build scripts on every push.

    Tools that pair well with the package.json Generator

    • JSON Formatter — Paste JSON to pretty-print, minify or validate it.
    • Git Command Generator — Pick a task like “undo the last commit but keep my changes” or “rename a branch on GitHub”, fill in your branch names and get the exact Git commands — each line explained, risky steps flagged.
    • .env File Validator — Paste a .env file to find invalid keys, duplicates, empty values and quoting mistakes, compare it with .env.example to spot missing variables, and generate a safe example file.
    • Changelog Generator — Paste your git log and get a tidy CHANGELOG.md section: commits grouped into Features, Bug Fixes, Performance and Breaking Changes, scopes in bold, links to commits — plus the next semantic version.

    Frequently asked questions

    What are the rules for npm package names?
    Lowercase only, no spaces, max. 214 characters, can’t start with a dot or underscore, only URL-safe characters (letters, digits, - . _ ~), and not a Node.js core module name like http. Scoped names look like @scope/name.
    Should I use "type": "module"?
    For new projects, yes — ES modules are the standard and work in Node.js 18+, Vite and most tools. Use CommonJS only if you depend on tooling that requires require().
    What does "private": true do?
    It makes npm refuse to publish the package, which protects apps and internal projects from being published by accident.
    Where do dependencies go?
    Install them with npm, pnpm or Yarn; the tool writes them into dependencies or devDependencies automatically.

    Related tools