It’s amazing to me how easy it is to get something quite functional up and running with node.js. A few NPM packages, access to a reliable source of data from a third-party API and you’re away.
Even finding details on APIs for anything is easy thanks to services like https://www.programmableweb.com/. It’s just a giant directory of anything and everything you might want to know about publicly available APIs.
Learning all this kind of makes me feel like I’m discovering coding superpowers. It’s so easy it feels like cheating.
NPM is the world’s largest software registry. Open source developers from every continent use NPM to share and borrow packages, and many organizations use NPM to manage private development as well.Docs.npmjs.com. (2019). About npm | npm Documentation. [online] Available at: https://docs.npmjs.com/about-npm/ [Accessed 22 Mar. 2019].
So what does all this mean? As a developer, you have super easy access to a vast collection of code packages that can be used in your own projects or processes. One such package that’s saved me a repetitive task is nodemon. Nodemon does the simple job of restarting node every time I save a code change.
To install a package like nodemon you simply use the command:
npm install -g nodemon
In this command, the “-g” installs nodemon globally. This means it will work in all node projects. To run it use the command “nodemon” and your node server will fire up. Then each time you save a change to your code, bam, the server restarts to reflect the code change.
NPM has just shy of a million packages. So, if you’re in need of something to support a project, npmjs.com should be your first destination.