JS Skeleton Project
About
This is a basic one-page JavaScript project which uses bower
and npm
for
package management, stylus
for CSS, browserify
for JavaScript
modules/dependencies, jasmin
for tests, jshint
for code quality enforcement,
and jake
for building and tasks (instead of gulp
or grunt
).
Getting started
- Install
node
athttps://nodejs.org/download/
. Also consider usingnvm
to manage different versions ofnode
$ npm install
$ npm install -g jake
to install Jake globally$ npm install -g bower
to install Bower globally$ bower install
to install Bower components$ jake
to build the project$ jake server
to start a server. Browsers connected to the server will automatically refresh if anything inbuild/
changes- Run Jake with
env=production
to build and minify source files and send them to thepublic/
directory (e.g.$ jake env=production
), or to serve thepublic/
directory without livereload or source watching (e.g.$ jake server env=production
) $ jake test
runs the tests
Adding packages
$ npm install some-package --save
, fornpm
packages$ bower install some-package --save
, forbower
components
Best practices
- Prefer
npm
modules over 'bower' components; if you can install an external JavaScript library with eithernpm
orbower
, usenpm
.
TODO
- Use
file
tasks for compiling JS and CSS - Make this into a
yeoman
recipe, or whatever those are called?