Skip to content

Instantly share code, notes, and snippets.

@wrpinheiro
Last active June 1, 2016 18:47
Show Gist options
  • Save wrpinheiro/8664f67dd9321eacd739d91983f436c0 to your computer and use it in GitHub Desktop.
Save wrpinheiro/8664f67dd9321eacd739d91983f436c0 to your computer and use it in GitHub Desktop.
Introduction to Javascript and Node JS

Introduction to Javascript & Node JS

This is a small guide that aims you to learn some Node JS and, of course, Javascript! This is not a reference nor a detailed guide, it's just a start up point.

A brief introduction

In the begining there were HTML. I was funny, but not that funny, because it was...static! We were not able deal with most user interations only with HTML. Then something happened which unleashed the power of our imagination...we learned to talk! No, it's not that! Then JS appeared to make our applications more attractive! With JS we were able to break the limitations imposed by the static HTML and now we live in a world of dynamic content. Note that everything we talked is related to JS running in the browser context, something that we call client side JS.

As time gone by, people have increased their interest in JS, due to its easyness, and started thinking: wouldn't this JS able to run on the server side either? And then something happened which unleashed...yes, then Node JS came in! Node JS is an interpreter that allows JS to run on server side. Isn't that such a fuckin' miracle? Yes, that is!

Of course that there are many details in the middle of this, but if you are curious, there are many books and blog posts that describe the facts in detail. C'mon, google it!!

Next section we'll show how to install some tools that'll be useful to create and run our examples.

Installation

  1. The first thing you should have is a browser! But I imagine that if you're reading this you already have one! So, one thing to check is if it's updated. If it's not, go ahead and updated it.

  2. If you want to be a developer, you must have an editor. There are many all around and it's your personal preference, just choose one and try to learn how it works. My suggestion is Sublime, but it's up to you. Find one and install it.

  3. Node Version Manager (a.k.a. NVM). NVM make easy to install and update node installation in you computer. Instead of install Node JS yourself, use NVM, it makes things organized. To install it just run the following command:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash

then the magic happens. You can check your installation issuing the following command:

nvm help

And you should se a help screen with all NVM commands. You can find more details in NVM's site.

  1. Set your node version
nvm install v6.2.0
nvm use v6.2.0

That's it! Now we're ready to start.

@rafael-buzon
Copy link

That's fun!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment