Fake package.json Generator
Generates realistic fake package.json files with dependencies, scripts, and metadata for Node.js projects
Generated 81 words · 969 characters
See 3 examples
- Example 1
{ "name": "mini-ion-api", "version": "0.9.3", "description": "Backend service for event ticketing", "main": "src/index.js", "scripts": { "start": "node src/index.js", "dev": "nodemon src/index.js", "test": "jest --coverage", "lint": "eslint src" }, "keywords": [ "express", "logging", "cors", "mongodb" ], "author": "Chloe Schmidt <chloe.schmidt@example.com>", "license": "BSD-3-Clause", "repository": { "type": "git", "url": "git+https://github.com/chloe-schmidt/mini-ion-api.git" }, "dependencies": { "express": "^4.12.0", "express-rate-limit": "^7.3.1", "express-validator": "^7.0.1", "http-errors": "^2.0.3", "node-cron": "^3.0.3", "swagger-ui-express": "^5.0.1", "winston": "^3.7.1" }, "devDependencies": { "cross-env": "^7.0.0", "husky": "^9.0.5", "jest": "^29.6.5", "lint-staged": "^15.0.9", "nodemon": "^3.1.4", "supertest": "^7.0.7" } } - Example 2
{ "name": "@alice-muller/cinder-recipes-api", "version": "0.10.8", "description": "HTTP API that powers recipe sharing", "main": "src/index.js", "scripts": { "start": "node src/index.js", "dev": "nodemon src/index.js", "test": "jest --coverage", "lint": "eslint src" }, "keywords": [ "express", "http", "api" ], "author": "Alice Müller", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/alice-muller/cinder-recipes-api.git" }, "engines": { "node": ">=18" }, "dependencies": { "cookie-parser": "^1.4.3", "dotenv": "^16.3.1", "express": "^4.19.4", "swagger-ui-express": "^5.0.0" }, "devDependencies": { "eslint-config-prettier": "^9.0.0", "eslint-plugin-import": "^2.19.1", "jest": "^29.7.2", "nodemon": "^3.0.1", "prettier": "^3.0.4", "supertest": "^7.0.6" } } - Example 3
{ "name": "signal-tasks-api", "version": "0.9.0", "description": "REST API for date formatting", "main": "src/index.js", "scripts": { "start": "node src/index.js", "dev": "nodemon src/index.js", "test": "jest --coverage", "lint": "eslint src" }, "keywords": [ "express", "endpoints", "cron" ], "author": "Hana Zhang", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/hanaz/signal-tasks-api.git" }, "dependencies": { "dotenv": "^16.3.8", "express": "^4.20.2", "ioredis": "^5.4.4", "joi": "^17.12.0", "knex": "^3.0.3", "mongoose": "^8.4.7", "pino-http": "^10.3.9" }, "devDependencies": { "@faker-js/faker": "^9.0.6", "cross-env": "^7.0.0", "eslint-plugin-import": "^2.21.7", "jest": "^29.4.0", "nodemon": "^3.0.3" } }
About this 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 always includes express and adds a random mix of common server packages such as cors, helmet, joi, winston, pg, redis, morgan, or jsonwebtoken, with nodemon and jest (plus tools like supertest or eslint) for development. React app pairs react and react-dom with react-scripts and a selection of libraries such as react-router-dom, axios, @tanstack/react-query, or zustand, with @testing-library packages among the dev dependencies. Next.js app builds on next, react, and react-dom with packages such as @prisma/client, next-auth, zod, or swr, and typescript, @types/node, and often tailwindcss for development. CLI tool is built around commander with helpers such as inquirer, chalk, ora, or fs-extra, and includes a bin field. Library keeps a minimal production set (tslib, sometimes one small helper) with rollup, typedoc, and jest for development, plus module, types, and files fields. 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 (sometimes scoped), a description, author, license, keywords, repository URL, and caret version ranges in the neighborhood of recent releases. Because the dependency list changes from click to click, you can generate several different fixtures for the same project type. Copy the output into your fixture, doc, or tutorial with no additional editing needed.
How to use
- 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 are illustrative and may not match a published release exactly.
what project types does this generator support
Five presets are available: express-api, react-app, nextjs-app, cli-tool, and library. Each preset has its own scripts block, core dependencies, and a pool of optional packages that are mixed differently on every click. 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.