About package.json generator
Fill in a short form and get a ready-to-use package.json for a new Node.js project.
Important fields
- name and version identify the package.
- main or exports show the entry file.
- scripts define commands such as start, build and test.
- license tells others how they may use your code.
A worked example
Enter a name such as my-tool, version 1.0.0, a description, MIT licence and an entry point of index.js. The generated file includes a scripts section with start and test, so npm start and npm test work straight away. Add your dependencies afterwards with npm install.
Good practice
- Use lowercase names with hyphens, and check that the name is free on npm before publishing.
- Follow semantic versioning from the start.
- Set repository and bugs URLs so users can find the project.
Next steps
After saving the file, run npm install to create the lock file, add a .gitignore with node_modules, and add a README before sharing the project.
