MongoDB ObjectId Generator
Generate and decode MongoDB ObjectIds, including their embedded timestamp.
Build a valid package.json with scripts, exports and metadata.
The package.json Generator builds a valid manifest with the module fields set correctly — type, main and the exports map — which is where most package.json problems actually come from, and where a generator earns its place.
package.json is small enough to write by hand and structured enough to get wrong. This builds a valid one from the fields you fill in, with the script preset for your kind of project and the metadata npm actually reads.
The fields that cause the most trouble are the ones about module resolution. `\"type\": \"module\"` decides whether your .js files are ESM or CommonJS, and getting it wrong produces the "Cannot use import statement outside a module" error that has no obvious cause. For a library, the `exports` map is what lets one package serve ESM, CommonJS and TypeScript types from the same install — and it replaces `main` rather than sitting beside it, which is why this generates both correctly rather than leaving you to work out the precedence.
Types, import and require in the right order, so one package serves ESM, CommonJS and TypeScript from a single install.
The field behind "Cannot use import statement outside a module" is set deliberately rather than left to chance.
Node, Vite, Next.js, Express, TypeScript or a published library — the scripts each of those actually needs.
Give it a GitHub path and repository, bugs and homepage are all filled in the shape npm expects.
Built as an object and serialised, so no trailing comma or unquoted key can slip in.
The package name, a starting version and a one-line description.
Plain Node, Vite, Next.js, Express, TypeScript or a published library.
One per line as name@range — they are split into the right sections.
Save it as package.json in your project root.
It makes every .js file in the package an ES module, so import and export work and require does not. Leave it out and the opposite is true. Files named .mjs and .cjs override it either way.
Keep it for older tooling, but exports wins wherever it is supported — and it is stricter: anything not listed in the map cannot be imported at all, which is the point. It is how a package stops people reaching into its internals.
It makes npm refuse to publish the package. For an application, a website or anything in a monorepo that should never go to the registry, it is the cheapest insurance against an accidental npm publish.
Use ranges in package.json and let the lock file do the pinning. That way a fresh install reproduces exactly what you tested, while npm update is still able to bring in patches when you ask for them.
What people who use the package.json Generator think of it. Reviews come from visitors and are posted as written.
No ratings yet
Yours would be the first.
0 reviews
Newest first
No reviews yet
Be the first to rate the package.json Generator. It takes half a minute and no account.
Write the first reviewGenerate and decode MongoDB ObjectIds, including their embedded timestamp.
Beautify, minify and validate JSON with precise error locations.
Infer a draft-07 JSON Schema from a sample document in one step.
Every HTTP status code, searchable, with what it actually means.
Generate correct CORS headers, and understand why the request was blocked.
Generate complete fake user profiles for seeding and design work.
Generate the border trick that makes triangles and tooltip arrows.
Rebuild nested JSON from flat dot-notation or bracket-notation keys.