Skip to main content

package.json Generator

New

Build a valid package.json from project metadata, npm scripts, and dependency lists — no syntax errors, no guessing field names.

package.jsonnpmnodegeneratorscaffolding
Read the guide
Shortcuts:⌘ KSearch
Continue with:

Frequently Asked Questions

How do I add scripts or dependencies?

Scripts use one line per entry in "name: command" form (e.g. "build: vite build"), and dependencies use one line per entry in "name@version" form (e.g. "react@^18.3.0"). The tool parses each line and drops it straight into the right JSON key.

What happens if I leave a dependency version off?

If a dependency line has no @version part, the tool falls back to "latest" as a placeholder — you should replace that with a real pinned version range before actually installing, since "latest" isn't a valid long-term lockfile-friendly range.

What does the "type" field actually control?

Setting type to "module" tells Node.js to treat .js files in the package as native ES modules (import/export) instead of the default CommonJS (require/module.exports) — it needs to match how your actual source code is written, or Node will throw a syntax error at runtime.

Why would I mark a package as private?

Setting "private": true is npm's built-in safeguard against accidentally running npm publish on a package that was never meant to be published (like an internal app or monorepo workspace root) — npm will refuse to publish it unless that flag is removed.

Does this validate that my dependency names and versions are real?

No — it only builds syntactically valid JSON from whatever names and version strings you type. It doesn't check the npm registry, so double-check package names and version ranges are correct before running npm install.

Related Tools