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.