Published at
Updated at
Reading time
1min
This post is part of my Today I learned series in which I share all my web development learnings.

Today I read Tierney Cyren's article 11 Simple npm Tricks That Will Knock Your Wombat Socks Off. It includes a bunch of npm magic, but one included idea made me stop.

Tierney creates GitHub repositories while calling npm init using an npm init script. Avoiding the step to go to GitHub and create a new repository manually is a fabulous idea. I started reading the npm docs to learn how to do this.

While reading, I learned that npm init translates to npx when you define an initializer (npm init [initializer]). ๐Ÿ˜ฒ

npm init foo -> npx create-foo
npm init @usr/foo -> npx @usr/create-foo
npm init @usr -> npx @usr/create

This behavior is quite handy, and it led me in a different direction. I couldn't hold it and had to publish a quick module to scaffold my future Node.js projects.

npm init @stfnjds

# or

npx @stfnjds/create

Use it as a GitHub template if you need a quick way to start projects. ๐Ÿ™ˆ

If you enjoyed this article...

Join 5.5k readers and learn something new every week with Web Weekly.

Web Weekly โ€” Your friendly Web Dev newsletter
Reply to this post and share your thoughts via good old email.
Stefan standing in the park in front of a green background

About Stefan Judis

Frontend nerd with over ten years of experience, freelance dev, "Today I Learned" blogger, conference speaker, and Open Source maintainer.

Related Topics

Related Articles