Jump To …

ready.js

continuous javascript integration

Version

3.0.1

Author

dsimard <dsimard@azanka.ca> (http://github.com/dsimard)

Repository

git - https://dsimard@github.com/dsimard/ready.js.git

Dependencies

  • optimist ~0.3.1
  • colors ~0.6.0
  • uglify-js ~2.2.2
  • jshint ~0.9.1
  • underscore ~1.4.3
  • async ~0.1.22
  • readdirp >= 0.2.2
  • minimatch ~0.2.9
  • fs-extra ~0.6.0

Stats

http://cloc.sourceforge.net v 1.55  T=0.5 s (16.0 files/s, 934.0 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
CoffeeScript                     8             84            133            250
-------------------------------------------------------------------------------
SUM:                             8             84            133            250
-------------------------------------------------------------------------------

ready.js - continuous javascript integration

Build Status

What does it do?

  1. Check if your javascript files are valid with jshint.
  2. Compile your javascript files with Uglify JS.
  3. (Later) Watch your javascript files for jshint while you're coding.
  4. Create an aggregated file of all your javascripts.

Installation

npm install ready.js --global

Usage

Usage: readyjs [FILES OR DIRECTORIES] [options]

Options:
  -o, --output    The file or directory in which to write the output                                
  -c, --config    Specify a config.json file                                           
  -i, --ignore    Ignore these files from JSHint but output them in the aggregated file
  -k, --keep      Keep individual minified files                                       
  --no-recursive  Don't recurse in sub-directories                                     
  -h, --help      Display this help                                                    
  -v, --version   Display the current version

Continuous integration

  1. run npm install ready.js --global
  2. run echo 'readyjs path/to/src -o path/to/dest' >> .git/hooks/pre-commit

Configuration file

You can use a configuration file with ready.js. It has to be a JSON with that format :

{
  "output" : "path/to/destination", // The file in which to write the output
  "ignore" : [], // Ignore these files from JSHint but output them in the aggregated file
  "keep" : false, // Keep individual minified files
  "no-recursive" : false // Don't recurse in sub-directories
}

Contribute

You can create issues.

You can also contribute code :

  1. Fork the code on GitHub
  2. Clone your fork in your environment : git clone git@github.com:USERNAME/ready.js.git
  3. Create a branch for your feature : git checkout -b your_branch_name
  4. Write and delete code and commit as often as you can : git commit -am "A descriptive message"
  5. Push the branch to your fork : git push origin your_branch_name
  6. Create a pull request on GitHub (click the Pull request button on your fork page)

API Reference

You can use this function readyjs.compile(sources, [options], callback(err, minified))

ready.compile(['./js', 'lib/cat.js'], {analyse:false}, function(err, minified) {
});

See main file for more information.

options

  • ignore default is [] : A list of files to ignore. (ex : _jquery*.js)
  • analyze default is true : If should analyze files through jshint
  • recursive default is true : If should go through directory recursively

callback(err, minified)

  • err : The errors that happened. If jshint didn't pass, err will contain formatted jshint errors
  • minified : The aggregated minified code for all files

Need more help?

generated Tue Oct 08 2013 12:10:31 GMT-0400 (EDT)