Sample package.json Generator
Generate sample package.json files for Node.js projects. Create configs for React, Next.js, Express, TypeScript, and more.
✨ Generated locally in your browser
Ready-to-Download Samples
Download pre-built sample files instantly. No configuration needed.
Minimal package.json
Basic package.json with just name and version (~50 bytes)
StarterBasic Node.js Project
Standard Node.js project structure (~400 bytes)
Node.jsTypeScript Node.js
Node.js with TypeScript configuration (~800 bytes)
TypeScriptReact Application
Modern React app with Vite and TypeScript (~1.2 KB)
ReactNext.js Application
Next.js 14+ App Router project (~1.5 KB)
Next.jsVue.js Application
Vue 3 with Vite and TypeScript (~1.1 KB)
VueCreate Custom File
Configure your own file with custom settings and content
Create production-ready package.json files in seconds. Whether you're starting a new React app, Node.js API, or NPM library—our generator provides templates for every project type.
What is package.json?
package.json is the manifest file for Node.js projects and NPM packages. It defines project metadata (name, version, description), manages dependencies, configures npm scripts, specifies entry points, and controls publishing settings. Created by running "npm init", this JSON file is essential for any JavaScript/TypeScript project using npm or yarn.
Why Use a package.json Generator?
Skip the manual setup and get started faster
Use proven configurations for popular frameworks
Ensure all required fields are properly formatted
Learn package.json structure through real examples
Generate consistent configs across team projects
Include common scripts and dependencies automatically
Avoid typos and configuration errors
Bootstrap new projects with best practices built-in
Common Use Cases
Starting New Projects
Generate a properly configured package.json for React, Vue, Next.js, Express, or any Node.js project in seconds.
Learning Node.js
Study real-world package.json examples to understand dependencies, scripts, and module configuration.
Creating NPM Packages
Generate publish-ready package.json with dual ESM/CJS exports, TypeScript types, and proper metadata.
CI/CD Pipeline Testing
Create sample package.json files to test build pipelines, dependency installation, and deploy scripts.
Generator Features
12 pre-built templates (React, Next.js, Express, etc.)
Customizable project name, version, and metadata
Common npm scripts pre-configured
TypeScript, ESLint, Prettier dependency options
ESM and CommonJS module support
Repository and homepage links
Node.js engine version specification
Real-time preview before download
How It Works
Configure
Customize your file settings using the form above
Preview
See your changes in real-time in the preview panel
Download
Download your file instantly - no signup required
Frequently Asked Questions
What is a package.json file?
package.json is the core configuration file for any Node.js project. It contains metadata about the project (name, version, description), lists dependencies, defines npm scripts, and specifies entry points. Every npm or yarn project requires a package.json file.
How do I create a package.json file?
You can create package.json by running "npm init" or "npm init -y" for defaults. Alternatively, use our generator to create customized package.json files with pre-configured templates for React, Next.js, Express, or other project types.
What is the difference between dependencies and devDependencies?
Dependencies are packages required to run your application in production (e.g., express, react). DevDependencies are only needed during development and testing (e.g., typescript, eslint, jest). DevDependencies are not installed when users install your package.
What does "type": "module" mean in package.json?
"type": "module" enables ES Modules (ESM) in Node.js, allowing you to use import/export syntax instead of require(). Without this field, Node.js defaults to CommonJS. Most modern projects use ESM for better tree-shaking and standards compliance.
How do I make my package installable via npm install?
To publish to npm, your package.json needs: a unique name, version, main entry point, and ideally description and keywords. Run "npm publish" after logging in with "npm login". For scoped packages, use @yourname/package-name format.
What are npm scripts and how do I use them?
NPM scripts are custom commands defined in the "scripts" field. Run them with "npm run <script-name>". Common scripts include "start" (npm start), "test" (npm test), "build", and "dev". Scripts can chain other commands and use pre/post hooks.