I am proud to announce my release for my TILerator project with npm.
Process for Creating a Release
The npm documentation provided substantial information on how to contribute to the registry. These are the steps I took in order to add my project to the npm registry and also the challenges I faced:
- This was my first time creating a release and publishing it to npm, so I needed to first create an account on npm.
- Within the terminal I logged into the newly created npm account using
npm login
. - One common file between all npm packages is the
package.json
file. npm uses this file to describe your package and manage your dependencies, and if you are planning to publish to the npm registry you must have this package.json file. If you are a just starting out with your project, runningnpm init
and following the instructing will help setup the package.json file for you. - The prerequisites have been completed and my project is now ready to be tagged with version number based on semantic versioning. Prior to this, my project was at
v0.9.1
and since it was ready to be released, I usednpm version major
to update it tov1.0.0
. - I then pushed my tags to GitHub using
git push --follow-tags
- Finally, it was time to publish to the registry with
npm publish --access=public
. If you have been following along with these steps for your own project and everything has been going well up to this point, then congrats! You have successfully managed to publish your package to the npm registry. Unfortuntely, for me, I had to do a little more fixing to my package. After running the publish command, I was faced with an error. I was initially quite confused by this error, but a quick Google search showed me that one of the reasons for this error was if there is already a package with the same name as mine on npm. To my surprise, a search on the npm website showed a package called "tilerator" that was published 7 years ago! After reading the npm documentation, I found out that I could scope my package to make it unique. You can make your package a scoped package by adding a scope name in between an@
and/
, followed by the name of your project, such as:@scopename/packagename
. I needed to change the name of my project inside the package.json file with my new scoped name,@mismathh/tilerator
and rannpm install
to also update the package.lock file. After repeating steps 4-5, runningnpm publish --access=public
worked. My release can be found here.
How to Install
npm install @mismathh/tilerator -g
User Testing
User testing went quite well in regards to the main functionality of the package, but it was brought to my attention that I needed to add more details to my README for the optional features. Using the --config
flag was quite difficult to use for them since they didn't know what options to add inside the config file, and also it was noted that I didn't have to use TILerator
in every command, and tilerator
was fine.
Learning Outcomes
It was a great learning experience to publish my project to the npm registry. Over my programming journey I have used many npm packages for my projects but I never got to experience how those packages are placed into a public registry for developers to use, until now.
Top comments (0)