Most JavaScript projects come with a package.json. But what if you want to make a new one?

This blog’s software is a great example. It’s statically rendered with Hugo, but as a JavaScript dev, I want my JavaScript tooling, too, so I need a manifest.

If you install a single dependency, you’ll get a package.json with that dependency. It works, but it’s just a scaffold.

The better command is:

$ npm init

This starts a dialog where you can choose sensible defaults for package name, version, description, entry point, Git repository, author, and license. It scaffolds you a test command, too.

See npm help init for more.