DEV Community

Cover image for Creating your first npm package

Creating your first npm package

Dan Vega on February 12, 2019

This weekend I started working on my first ever npm package. I can't believe for how long I have been writing code that I never bothered to create ...
Collapse
Β 
dance2die profile image
Sung M. Kim β€’

This is an article I wish I had read before struggling so long to publish an NPM package πŸ‘

Collapse
Β 
therealdanvega profile image
Dan Vega β€’

Aww thank you for the kind words :)

Collapse
Β 
jvarness profile image
Jake Varness β€’

Totes gonna use wrap-with-poo in my next package.

Collapse
Β 
juanfrank77 profile image
Juan F Gonzalez β€’

As always you bringing in the real value Dan, thanks a lot for this! Been wanting to do this for quite some time but it seemed so daunting

Collapse
Β 
therealdanvega profile image
Dan Vega β€’

You are too kind Juan. Thank you, my friend :) It does seem pretty overwhelming until you realize it isn't :)

Collapse
Β 
gifco profile image
GifCo β€’

Ok this is great and all but it's 2019 and your example would be most suitable for front end use so why would you NOT even mention that thia should be published as an ESM not common.js. or ideally both.

Collapse
Β 
therealdanvega profile image
Dan Vega β€’

Great questions. I just thought this was a good starting point. It's hard to talk about something new and not include everything the reader might need. I thought I would keep this simple and stick to the basics but I do appreciate your feedback. Thank you, Giff.

Collapse
Β 
chinmayj93 profile image
Chinmay Joshi β€’

Timing of your blog couldn't be better. I'm struggling with some problems, and going to refer this to solve the issues.

Thanks!!!

Collapse
Β 
therealdanvega profile image
Dan Vega β€’

Great to hear. Let me know if you run into any issues, I am always looking for something to write about.

Collapse
Β 
_mertsimsek profile image
Mert Simsek β€’ β€’ Edited

Thank you for article, that's a spirit :)

Collapse
Β 
feralamillo profile image
Feralamillo β€’

Great tutorial!! I followed and have my first npm package live: npmjs.com/package/check-osaurus

thank you very much for the tips. I wonder if there is a better way to connect directly from github instead of having to do it manually.

Collapse
Β 
apol0x profile image
Apol0x β€’

Thank you so much for the post,I thought a lot of times inform myself about this, and you explain it very clear

Collapse
Β 
therealdanvega profile image
Dan Vega β€’

Thank you :)

Collapse
Β 
antonreshetov profile image
Anton Reshetov β€’

It is very strange to start with version 0.0.1, that is, with fix bug

Collapse
Β 
therealdanvega profile image
Dan Vega β€’

Why is it strange? I am saying that this is the very first release of my plugin. It has some work to do before I consider it a stable 1.0 release.

Collapse
Β 
antonreshetov profile image
Anton Reshetov β€’

Because it is incorrect to start versioning from the version which is intended for a fix of any bug
semver.org/#how-should-i-deal-with...

Thread Thread
Β 
therealdanvega profile image
Dan Vega β€’

Oh, I thought it was at 0.1.0. Yes, I would agree with that. Will update, thank you!

Collapse
Β 
avinashd10 profile image
Avinashd β€’

Hi, thank you for simplification example on publishing our own package to npm.

Collapse
Β 
craigiswayne profile image
Craig Wayne β€’

Thank you Dan!

Been meaning to actually start packaging our angular components into independent npm packages.

Didn't know where to start! So thank you so much for this πŸ₯³

Collapse
Β 
strahinjalak profile image
Strahinja Laktovic β€’

Thanks for the article Dan, really well written and comprehensive. I look forward to reading your sequel about adding testing to the package !

Collapse
Β 
panthablack profile image
panthablack β€’

Thanks for this - saved me loads of time and nudged me to publish my first package! Nice one.

Collapse
Β 
monicat profile image
Monica Macomber β€’

I’ll need to do this soon at work, saving the article for reference πŸ™ thanks!

Collapse
Β 
mxrcochxvez profile image
Marco Chavez β€’

Just wanted to thank you! I was able to write my first npm package because of this!

Collapse
Β 
pedrohenriquebr profile image
pedrohenriquebr β€’

I read it before I published my "@pedrobr/autonomous" package! thank you man !

Collapse
Β 
moyarich profile image
Moya Richards β€’

nice tutorial

Collapse
Β 
jwp profile image
JWP β€’

Thanks Dan Vega!

Collapse
Β 
keeeeith profile image
Keith Burgie β€’

Made an account here just to say thanks! This was very helpful.

Collapse
Β 
horiyomi profile image
horiyomi β€’

Thanks, this is really helpful

Collapse
Β 
vikasmagar512 profile image
Vikas Magar β€’

Hey, thanks for this awesome Tut. Keep writing :)

Collapse
Β 
garryho7 profile image
πŸ’šπŸ¦€A Nice Guy ;) (#BLM)πŸ¦€πŸ’š #ReplGang β€’

You should include /types

Collapse
Β 
luucamay profile image
Lupe πŸ‡§πŸ‡΄ β€’

Amazing!

Collapse
Β 
rrakso profile image
rrakso β€’ β€’ Edited

I've just downloaded verdaccio.org/ so I can push my own packages to private online registry! <3

Collapse
Β 
realsaeedhassani profile image
Saeed Hassani Borzadaran β€’

Thanks :)