Node.js

From Han Wiki
Jump to navigation Jump to search

Administrative

Upgrade Node.js to the latest version via NPM

  • Last tested on Ubuntu 16.04 LTS (xenial) | easy | less than five minutes
# check the current version number
$ node -v

# clean cache forcefully
$ sudo npm cache clean -f

# install n Module
$ sudo npm install -g n

# install Nodejs
$ sudo n stable

# setup binary link -- use the version number for the folder path
$ sudo ln -sf /usr/local/n/versions/node/6.0.0/bin/node /usr/bin/node

# check updated Nodejs version
$ node -v

Packages

browser-sync

Browsersync

Your indispensable test assistant. With each web page, device and browser, testing time grows exponentially. From live reloads to URL pushing, form replication to click mirroring, Browsersync cuts out repetitive manual tasks. It’s like an extra pair of hands. Customise an array of sync settings from the UI or command line to create a personalised test environment. Need more control? Browsersync is easily integrated with your web platform, build tools, and other Node.js projects.

lite-server

lite-server

Lightweight development only node server that serves a web app, opens it in the browser, refreshes when html or javascript change, injects CSS changes using sockets, and has a fallback page when a route is not found.