DEV Community

Cover image for My first NPM library — pronouns.js

Posted on

My first NPM library — pronouns.js

Hey all! This is my first post on DEV... Let's see how it goes.

My story

I started writing a library a while ago — back in January — for a way to CRUD pronouns in JavaScript. (Don't worry, it's not as bad as I made it sound.) I originally needed this for my Discord bot, but after many searches on NPM, I realized I was going to have to write this myself. I, being my unimaginative self, decided to call it pronouns.js.

So I followed countless tutorials on NPM packaging with no results for a while, eventually giving up. After a week or so, I went back to NPM's docs and looked through them again. And finally, some success! I left it and came back to it a lot, bringing it to its current state.

It's been through a lot of changes since its first release. v1.0.0 only worked with TypeScript, and the docs I wrote were horrid. I was publishing up to 5 different minor versions on some days. (Now I know better.) Eventually, I realized that JavaScript users would not be able to use it at all, setting me on the journey of learning to use declaration files.

Then came the final stretch: this past month, I've been frantically editing JSDoc comments to generate some readable documentation. I stumbled upon Docma a while ago, and its beautiful layout immediately convinced me to use it. After spending hours messing around with my docma.config.jsonc file, I got frustrated once again. The docs simply would not render images and HTML in Markdown properly, and it was also completely ignoring a type definition. I couldn't find any other packages using Docma, so I had no example to follow. I stopped working on this project and started writing a CLI file trashing system. When I looked for a simple JSON key-value database system, I was shocked — its docs were built using Docma. Quickly picking up the semantics of the config file, I built the docs properly, and this time it all fell together.

That brings this story to the present time, at which I have published some docs here. I am waiting on DNS verification, but if all goes well, the same site will be hosted on this fancy subdomain. The NPM package can be viewed here, and the GitHub repository is akpi816218/pronouns.js.

I, as a result of learning how to do this, now have 5 packages on NPM.

Thanks for reading, and have a great pride month!



pretty docs!!!

Top comments (1)

vulcanwm profile image

looks nice!