Package.json Generator

Generate valid package.json manifests with scripts, dependencies, TypeScript, and ESLint configs.

100% Free · No Sign-up · Runs in Your Browser

About the Package.json Generator

Every Node.js and JavaScript project begins with a 'package.json' manifest defining project metadata, entry points, lifecycle scripts, and dependency trees. Creating a valid 'package.json' by hand requires proper JSON formatting and knowledge of module configuration fields. This Package.json Generator creates valid, structured 'package.json' files interactively.

This tool is useful for developers bootstrapping new libraries, CLI tools, web applications, or npm packages. It configures package names, version strings, module types (ES Modules 'type: module' vs CommonJS), build and dev scripts ('tsx', 'tsc', 'eslint'), and pre-configured dependencies.

To use it, enter your package name, version, author, license, and module type, and toggle TypeScript or ESLint configurations. The tool generates validated JSON that you can copy or download as a 'package.json' file.

For example, selecting 'ES Modules' with TypeScript automatically sets type to module, configures a 'build' script to run 'tsc', and adds '@types/node' and 'tsx' to devDependencies.

A common npm mistake is forgetting to specify the 'license' field or using non-SPDX license identifiers. This tool ensures compliant license strings (e.g. 'MIT', 'Apache-2.0').

Tip: Place the downloaded 'package.json' in an empty project directory and run 'npm install' to install all configured packages immediately.

Frequently Asked Questions

Q.What is the difference between 'module' and 'commonjs' type?

Setting 'type: module' enables native ES6 import/export syntax in Node.js, while 'commonjs' uses require() and module.exports.

Q.Does the generated JSON pass strict validation?

Yes, the output is formatted and validated as standards-compliant JSON.

Q.Can I download the file directly?

Yes, click 'Download' to save the file with the exact 'package.json' filename.

Related Tools