Skip to content

Instantly share code, notes, and snippets.

@tps2015gh
Last active March 23, 2017 03:06
Show Gist options
  • Save tps2015gh/0a6b35302d4f53b1a1e0bc6dd8b49d59 to your computer and use it in GitHub Desktop.
Save tps2015gh/0a6b35302d4f53b1a1e0bc6dd8b49d59 to your computer and use it in GitHub Desktop.
Node_JS_Brief.MD

Update / Upgrade

REF : http://stackoverflow.com/questions/8191459/how-do-i-update-node-js

//Clear NPM's cache:

  • npm update npm -g

//Install a little helper called 'n' , sudo is for linux

  • sudo npm cache clean -f

//Install a little helper called 'n' , sudo is for linux

  • sudo npm install -g n

//Install latest stable Node.js version , sudo is for linux

  • sudo n stable

// If you have Homebrew installed (only for OS X):

  • brew upgrade node

Run Node Server

REF : http://stackoverflow.com/questions/10577879/starting-a-node-js-server

  • node app.js

Node.js Module

   npm install -g browser-sync
   browser-sync start --server --files "css/*.css"                    <== static site 
   browser-sync start --proxy "myproject.dev" --files "css/*.css"     <== dynamic site

command line https://www.browsersync.io/docs/command-line

npm install -g testcafe
testcafe chrome,firefox tests/

การใช้งาน ส่วนประกอบต่างๆ

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