Skip to content

Quick Intro To Node and NPM

NodeJavascript

Warning: This article is over a year old, and a bit short. It's probably no longer a great place to start. Read on at your peril.

Node and NPM for Beginners

What is Node.js? If you've had a bit of a break from the web development industry, or maybe if you're just beginning and learning web development, you'll see Node and NPM being mentioned a LOT and touted as the best thing since sliced bread. And you might be wondering what all the fuss is about and what they are. Well this post is here to hopefully give you a really quick intro and possibly get you up to speed!

Node; Introducing Server Side Javascript

To put it as simply as I possibly can, Node is a way to use Javascript on the server. Traditionally Javascript is only used in the browser, hopefully to do dynamic effects (such as user interactions etc) that can't be achieved with HTML & CSS. Node allows us to use Javascript to execute server side tasks. Javascript is a really flexible and quite powerful scripting language, and these features combined with the ability to execute server side have lead to a huge explosion in the popularity of Javascript.

Node works around a very modular style of execution where smaller, manageable chunks of code are bundled into their own "modules" (note, you don't have to do it this way, but this is the way it tends to work). This preference for modules of code led to the creation of many packages built by developers that can easily be plugged into any project.

NPM, or the Node Package Manager

The emergence of these pluggable packages for Node scripts then led to the creation of NPM which both a repository for Node packages, and a command line tool to administer them with. If you have history with RubyGems or Composer for PHP this might be vaguely familiar to you. Essentially, NPM manages the installation of these Node packages within your project.

What can Node.js do?

Pretty much anything! Thanks to the huge collection of open-source packages available Node is used to do many server side tasks, from the most obvious - acting as a webserver, to serving REST APIs, database backends, messaging middleware, static file server and more.