How to create your own personal npm business card

Have you ever thought about creating and publishing an npm package named like you? To be honest, I haven’t thought about that and had no use-case for it until I came across this tweet of Max Stoiber:
My first thought: “Damn, why haven’t I thought about that too!”.
After reading some of the replies, I found the original repository from Tierney Cyren with his npm card he and others forked from. There’s even a create-my-card
module available already.
Create your own npm card
You either fork Tierney’s code or one of the many other forks (eg. here’s mine).
As soon as you’ve cloned the repository onto your local computer edit ./bin/card.js
:
- Add, replace or remove existing information with your own,
- update the actual string that’s going to be visible,
- and finally, choose the order you want your data to be presented.
So much for the card.js
file. Once you’ve saved it check in the file again. Before you share the card with the rest of the world, there’s one last thing to do:
- Update
package.json
and replace thename
,description
,bin
andauthor
with your data.
Okay, now we are ready. Create a new version and publish the package:
$ npm version minor
(will create a new minor version of your package, eg. 0.1.0 -> 0.2.0)$ npm publish
And voila, your package is online and others can use it now. Awesome!
For instance, here’s mine: https://github.com/natterstefan/businesscard
$ npx natterstefan
So next time you are at a conference, networking event or you are a speaker you can simply share this command with other developers and present your next level business card. 😅
PS: Share your npm business card with me on twitter: https://twitter.com/natterstefan.