Setting NPM init defaults

One of the first npm things I learned was how to set default author details

npm init

Does the email address you use change between projects? Not very likely! How about your name? Or your website url? Chances are these don’t change all that often, yet when you run npm init it’ll ask you to fill these in every time. And yeah.. you can skip these - but there’s a better way!

Just like how git lets you set a user name and email address, npm allows you to set a default name, email address and url.

Set defaults using npm set

To set your username, use npm set init-author-name "My name". To set an email address, use npm set init-author-email "".

The full list of available defaults can be found in the npmjs docs.