Ein Blog

Wer häufiger mal npm-Module anlegt, verwendet dafür vielleicht oft npm init.

Der Befehl ist seit Jahren standard, aber die Werte darin sind immer noch alt. Beispielsweise legt es das Projekt per Default als commonjs-Modul an. Das steht aktuell noch als Änderung aus, aber man kann die Defaults in der globalen Config setzen:

npm config set init-type module

Darüber hinaus kann man auch ein paar andere Defaults setzen, die man sowieso immer setzt. Für mich sind das beispielsweise:

npm config set init-license MIT # defaults to ISC
npm config set init-author-email test@example.com
npm config set init-author-name "M. Mustermann"
npm config set init-author-url "https://github.com/mmustermann"
npm config set init-private true