Skip to content

Instantly share code, notes, and snippets.

@DevEarley
Last active June 3, 2017 02:16
Show Gist options
  • Save DevEarley/d326d8ed15a6efa6acfda55b5e942fbe to your computer and use it in GitHub Desktop.
Save DevEarley/d326d8ed15a6efa6acfda55b5e942fbe to your computer and use it in GitHub Desktop.
a bunch of helpful bash commands
// see what you have installed globally
npm ls -g --depth 0
//quickly scss compile files
$ node-sass site.scss site.css
//or
$ node-sass /dir /out
//yarn provides vanilla angular
$ yarn add xxxx
$ yarn add angular
$ yarn add angular-material
//angular cli provides angular with typescript
$ npm install -g angular-cli
$ ng new xxxx
$ cd xxxx
$ ng serve
//start a local http server
$cd xxxx
$http-server
//start a local http server with watch functionality (and much more)
$ cd xxxx
$ watch-http-server
//-p Port to use (defaults to 8080)
//-a Address to use (defaults to 0.0.0.0)
//-d Show directory listings (defaults to 'True')
//-i Display autoIndex (defaults to 'True')
//-e or --ext Default file extension if none supplied (defaults to 'html')
//-s or --silent Suppress log messages from output
//--cors Enable CORS via the Access-Control-Allow-Origin header
//-o Open browser window after staring the server
//-S or --ssl Enable https.
//-C or --cert Path to ssl cert file (default: cert.pem).
//-K or --key Path to ssl key file (default: key.pem).
//-h or --help Print this list and exit.
$ watch-http-server -o -s -p 9001 -a localhost
//For best results, uses node-sass --watch and watch-http-server
//while coding. As you change scss node-sass will pick up on them and then
//watch-http-server will see the css change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment