Taking some oldschool browser style modular code and showing how it could look using current practice.
- Promises instead of callbacks, and error propagation
- Using modules instead of global namespace
- Using modules instead of IIFEs for private scope
- Importing dependencies
- Shorthand objects
- Default parameters
- Sets
- io.js 2.3+
npm install
gulp auto-reload
- open http://localhost:9966
- Using concat build as default, can swap out to browserify & babel build by changing the build task to use
client
instead ofconcat
- Static resources live in assets folder, and are copied to
static
when app runs. this is created if needed, and ignored by git.
- if have node already installed, can get
n
for managing node versions npm install -g n
will globally installn
n io latest
will install latest stable version of io- just running
n
on its own will show a list of available local versions
- ESLint supports more syntax variations than jshint 'out of the box'
npm install -g eslint
- Will use either a
.eslintrc
file in home dir, or in root of project folder - Sublime linting is achieved with
Sublimelinter-contrib-eslint
etc - Sample rc is included in this project (opinions warning!)