Ready.js is a tool to prepare your javascript files for production. It can be used in every type of web project (Rails, Django, node, etc). It does four things :

  • Check if your javascript are valid with jslint.
  • Minify your javascript with Closure Compiler (optimize and minify your code).
  • Watch your javascript files for jslint while you're coding.
  • Create an aggregated file of all your javascripts.

Ready.js is written in node.js and the source code is available on github.

How to install it

First, all you need it to install git and node.js. Then, you do the following :

  1. run git submodule add git:// ready.js
  2. run cd ready.js && git submodule init && git submodule update && cd ..
  3. Create config file in your_project/ready.conf.js :

     { src : "./javascripts", // the source dir of js files
         dest : "./minified", // the destination of your minified files
         minifiedExtension : "min", // Extension of the minified file 
         runGCompiler : true, // if should run GoogleCompiler
         aggregateTo : "./minified/all.js" // Which file to aggregate all javascript files 
  4. run echo 'node ready.js/ready.js ready.conf.js' >> .git/hooks/pre-commit

Then, every time you commit, ready.js will be run. You can see alternative installations on the github page.

Why this tool?

First, I wanted to write something in node.js. Javascript is a long time favorite of mine and I'm really excited about node. Second, I wanted to have a build tool for jsKata and I hated all of them. Third, I don't like the “cache” principle in Rails and wanted to have something else.

Try Ready.js today!