universal
grunt-init
template for making a universal JavaScript module
Features
- Universal Module Definition: src/ uses a UMD boilerplate that works in CommonJS, AMD, and/or browsers. UMD patterns make code work in multiple contexts and with various build tools.
- grunt: The included universal GruntFile uses these grunt plugins to perform common tasks.
- aok: test/ contains a boilerplate for writing tests with aok or another test framework.
Usage
You'll need to have installed git, node.js (including npm), and grunt-cli on your machine.
Install grunt-init
and the template
$ npm install -g grunt-init$ git clone https://github.com/ryanve/universal.git .grunt-init/universal
Setup a new project via the template
$ mkdir example # or clone a repo $ cd example$ grunt-init universal
devDependencies and then run grunt tasks
Install$ npm install # install dependencies listed in local package.json
grunt tasks
Builds for distribution are created in the package root via grunt
based on the package.json .main
field.
$ grunt jshint:all # jshint all applicable files $ grunt jshint:sub # jshint in all sub dirs $ grunt test # run tests $ grunt build # generate a build in the package root named by .main in package.json $ grunt # run the "default" task
Resources
- jshint options
- package.json documentation
- semver.org
- example modules: energy, fm, actual, lap, vibe
- Ask questions or report issues
License
MIT