Node Mode

The past two days of our introduction to back-end have been primarily focused on working with Node.js. For those not familiar, Node is an asynchronous, open-source, JavaScript runtime environment.
I previously thought Node was a ‘framework’, but learned today that it differs in that most frameworks actually contain their own runtime environs, and also have their own internal libraries.

A notable aspect of Node is that it allows you to work with AND run your code completely outside of the browser — a significant shift from a front-end approach, which almost exclusively focuses on browser presentation and display.

In addition to brushing up on some new terminology and getting basic instruction on how to install and run Node, we jumped into a few programming exercises to practice running our code and working through error message syntax via the terminal. We were also introduced to the world of npm (Node Package Manager), which allows you to download “packages” of other people’s code to incorporate into your own programs.

Last night’s assignment involved downloading and utilizing the ‘moment’ and ‘chalk’ npms to create a very simplistic program to run in the terminal. It ended up looking like this:

Program running in terminal
Program code

As you can see from the code above, the ‘chalk’ npm enables color change assignments to text in the terminal through very brief code additions, while ‘moment’ allows you to track and evaluate varieties of information related to time — including time zones, daylight savings considerations, duration of time broken down into a variety of increments, etc.

I definitely see how npms are extremely useful resources to have on hand, as they allow you to incorporate a bunch of cool functions and features into your program without implementing a ton of extra code. Excited to continue playing around here for a bit and seeing what else I can find…

Song of the Day: “Never Been Wrong” by Waxahatchee