Day 34: npm Registry and Private Packages

Was reading up on .npmrc files and why they are used and stumbled on a whole section of topics I never knew were important. Previously I had mentioned that I want to build my own package and post it on npm. Well today I dove into learning how to do it. It is surprisingly straightforward. The challenge comes with private packages that you still want to use with npm. I have a lot more to read in the docs but yeah… that seems a lot more complicated.

TLDR;

Okay, so here are the highlights of what I did:

  • npm -> Started taking notes on npm. These notes are intended to go beyond the basics of installing/updating packages. I need to read a lot more of the docs first though.
  • Practice -> Continued working on the Inventory Management Application project from The Odin Project. Started working on updating the controllers for the item routes.

npm Registries

An npm registry is where npm packages are stored. There are two types of registries I know of:

  • The is the public registry that is well known and is used by most developers to download popular packages and then there
  • The private registry

The Public npm Registry

The public npm registry is a database of JavaScript packages, each comprised of software and metadata. Open source developers and developers at companies use the npm registry to contribute packages to the entire community or members of their organizations, and download packages to use in their own projects.

To get started with the registry, sign up for an npm account and check out the “Getting started” and CLI documentation.

The Private npm Registry

To use private packages, you must:

  1. Be using npm v2.7.0 or greater.
  2. Have a paid user or organization account

To upgrade npm, on the command line, run:

npm install npm@latest -g

With npm private packages, you can use the npm registry to host code that is only visible to you and chosen collaborators, allowing you to manage and use private code alongside public code in your projects.

Private packages always have a scope (e.g. @babel), and scoped packages are private by default.

User-scoped private packages can only be accessed by you and collaborators to whom you have granted read or read/write access. For more information, see “Adding collaborators to private packages owned by a user account”.

Organization-scoped private packages can only be accessed by teams that have been granted read or read/write access. For more information, see “Managing team access to organization packages”.


Goal For Round 8 of the #100DaysofCode Challenge

This is my eighth round of the “#100daysofcode” challenge. I will be continuing my work from round five, six, and seven into round eight. I was working through the book “Cracking the Coding Interview” by Gayle Laakmann McDowell. My goal was to become more familiar with algorithms and data structures. This goal was derived from my goal to better understand operating systems and key programs that I use in the terminal regularly e.g. Git. This goal was in turn derived from my desire to better understand the fundamental tools used for coding outside of popular GUIs. This in turn was derived from my desire to be a better back-end developer.

I am currently putting a pause on the algorithm work to build some backend/full stack projects. I primarily want to improve my skills with the back-end from an implementation perspective. I have improved tremendously in terminal and CLI skills but I lost focus due to how abstract the algorithm concepts got. I wanted to work on things that were more tangible until I can get to a position where I could directly benefit from improving my algorithm skills and theoretical knowledge. So that’s the focus right now. Build my backend skills and prove my full stack capabilities by building some dope projects.

Again, I still have no idea if my path is correct but I am walking down this road anyways. Worst case scenario I learn a whole bunch of stuff that will help me out on my own personal projects. Best case scenario I actually become one of those unicorn developers that go on to start a billion dollar company… You never know LOL.