package.json Generator
Build a minimal package.json: name, version, description, scripts, license, repository, type (module/commonjs). Everything in your browser.
A minimal package.json without the prompts
npm init walks you through ten questions in the terminal, and npm init -y hands back fields you will delete anyway. Here you fill in name, version, description, author, license, type (module or commonjs) and main, and the JSON updates on every keystroke, indented and ready to save. An empty description or author is dropped from the output instead of sitting there as an empty string.
The field that trips people up is type. Choosing module changes what every .js file in the package means: they become ES modules, require and __dirname are gone, and relative imports need the extension (./util.js). A file that has to stay CommonJS must be renamed .cjs. The name field is not validated here either, and npm only accepts lowercase, no spaces, 214 characters max, so something like My Project is rejected at publish time.
The scripts are fixed: start runs node against whatever you typed into main, and test is the placeholder that exits with an error. Replace both once you paste. There is no field for dependencies, repository or exports, and dependencies do not need one anyway since npm install writes them for you. If the project is private, add private true by hand, because that is the flag that stops an accidental publish. All assembled in the browser.
Frequently asked questions
module or commonjs?
What is the difference between main and exports?
Does version matter if I never publish?
Related Tools
SemVer Range Tester
Tests which versions satisfy a semver range (^1.2.3, ~2.0, >=1 <2) and explains the range as a lower and an upper bound.
tsconfig.json Generator
Generate a custom tsconfig.json: ES target, module, strict, paths, JSX, declaration and more. Validation against invalid options. Everything in your browser.
vercel.json Generator
Create a vercel.json with routes, redirects and HTTP headers ready for your Vercel deploy. Set it all up in the browser and drop it into your repo.