Dev
Fake package.json Generator
Tutorial authors, open-source maintainers, and test-fixture builders all hit the same wall: they need a realistic package.json but writing one by hand means picking plausible package names, inventing believable version numbers, and remembering the right script conventions for each project type. This generator handles all of that in one click. The Project Type selector determines the entire shape of the manifest. Express API outputs an express, cors, helmet, joi, winston, pg, and redis dependency set with dev dependencies for nodemon, jest, supertest, and eslint. React app includes react, react-dom, react-router-dom, axios, @tanstack/react-query, and zustand, with @testing-library/react in devDependencies. Next.js app covers next, @prisma/client, next-auth, and zod as production deps, with prisma and @types/node for development. CLI tool produces commander, inquirer, chalk, ora, and fs-extra. Library outputs a minimal production dependency set (tslib) with rollup, typedoc, and jest for development. The Include Dev Dependencies toggle lets you strip devDependencies entirely when documenting a runtime-only manifest. Each generated file includes a randomized but plausible project name, author, license, keywords, and version numbers close to recent releases. Copy the output into your fixture, doc, or tutorial with no additional editing needed.
How to use
- Choose your options above
- Click Generate
- Copy your result
Detailed instructions
- Select the project type that matches your use case (Express API, React app, CLI tool, etc.) from the dropdown.
- Choose whether to include dev dependencies — select 'yes' for a full project setup or 'no' for a runtime-only manifest.
- Click the generate button to produce a complete, formatted package.json with dependencies, scripts, and metadata.
- Review the output, then copy it using the copy button and paste it into your project, fixture file, or documentation.
Use Cases
- •Illustrating a package.json in a tutorial or article
- •Testing a tool that reads or validates manifests
- •Scaffolding an example project structure
- •Demonstrating dependencies and scripts in documentation
- •Generating a realistic manifest fixture for tests
Tips
- →If you are generating fixtures to test a dependency parser, run the generator several times with different project types to get varied package names and script shapes.
- →For tutorial screenshots, set includeDevDeps to 'yes' so the dependencies object looks like a realistic project rather than a stripped-down example.
- →After copying the output, do a quick search-replace on the placeholder author and repository URL — it makes demo repos look much more convincing without any manual JSON editing.
- →CLI tool outputs produce a bin field in the JSON, which is useful if you need to test tooling that specifically handles executable package configurations.
- →Cross-reference the generated version numbers against npmjs.com for any packages you plan to keep in a real project — most are close but may lag a major version behind.
FAQ
what is a package.json file
A package.json is the manifest file at the root of a Node.js or JavaScript project. It records the project name and version, its dependencies, and scripts like build and test, plus metadata. Tools read it to install packages and run tasks, which is why a realistic example is useful for testing and teaching.
is the generated package.json valid JSON that can be used directly
Yes — the output is properly formatted JSON with standard fields. It works as a teaching example, a parser fixture, or a starting point. Adapt the name, dependencies, and scripts to your actual project before using it in a real Node.js project, since version numbers and package names are illustrative.
what project types does this generator support
Five presets are available: express-api, react-app, nextjs-app, cli-tool, and library. Each preset produces a different set of production and dev dependencies and a matching scripts block. Custom project types are not supported — pick the closest preset and add or remove packages manually after copying the output.
what fields does a package.json need
At minimum a name and version, but most include scripts, dependencies, devDependencies, and metadata like description and license. The generated manifest includes these common fields so it reads like a genuine project file, which you can trim or extend to match your needs.
You might also like
Popular tools from other categories that share themes with this one.
Try these next
More free tools from other corners of the catalog, picked by shared themes.