Ambiente di sviluppo JavaScript


Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. It uses an event-driven, non-blocking I/O model that makes it lightweight and efficient.


Created By Ryan Dahl in 2009

v0.12.17 ==> v4.0.0

Joyent sponsored the project from the beginning

At the end of 2014 Fedor Indutny forked Node.js and created io.js

io.js was created as an open governance alternative with a separate technical committee

io.js started using a semantic versioning for the project

In September 2015, Node.js v0.12 and io.js v3.3 were merged back together into Node v4.0



NPM stands for node package manager

is the largest ecosystem of open source libraries in the world.

NPM invites the developers to use semantic versioning, aka semver

  "name": "our-dummy-project",
  "version": "0.0.1",
  "description": "This is a dummy project",
  "main": "index.js",
  "author": "extrategy",
  "license": "MIT",
  "scripts": {
    "start": "http-server"
  "dependencies": {
    "lodash": "4.17.2"
  "devDependencies": {
    "http-server": "1.0.0"

a package.json file

NPM commands

npm init
npm install / uninstall
npm run x
npm publish / unpublish


NVM stands for node version manager


nvm ls / ls-remote

nvm install /uninstall

nvm use


Event loop

JavaScript has no threads

All I/O operations in Node.js are non-blocking

High Performances


Error-first Callbacks

AKA node-style callbacks

Task Runners

Applications that automate time consuming and boring tasks

Make your life easier when developing for the front-end by automating tasks

- compile modified SASS to CSS

- minify javascript and CSS files

- watch for changes

- run tests


Created by Ben Alman in 2012, written in node.js, distributed via npm

Thousands of plugins

Tasks defined by configuration


Ability to define custom tasks, which can combine multiple existing tasks into a single task or add entirely new functionality

Processed files are stored in tmp folders and then passed as imput to the next task, and so on


Similar Grunt modular architecture and plugins system

Tasks defined by code


Uses node streams: gulp reads the fs directly and passes the data via .pipe() to the next plugin

No use of tmp folders, decreasing the number of I/O calls, improving performance

Defines itself as a
"module bundler"

It splits your app into multiple files. If you have multiple pages in a single-page app, the user only downloads code for just that page. If they go to another page, they don't redownload common code

from this... this

The result is clean, reusable code. Each individual component depends on import-ing its own dependencies, and export-ing what it wants to make public to other modules

Useful links

That's It!


Ambiente di sviluppo JavaScript

By extrategy

Ambiente di sviluppo JavaScript

  • 1,552