Ready.js – continuous integration using jslint, nodejs and git

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://github.com/dsimard/ready.js.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!

  • http://www.build-doctor.com/2010/11/02/links-for-2010-11-02/ The Build Doctor › Links for 2010-11-02

    [...] ReadyJS: Continuous Integration for JavaScript http://www.javascriptkata.com/2010/10/28/ready-js-prepare-your-javascript-for-production/ [...]

  • http://www.viget.com Doug Avery

    Question: how do I specify aggregation order with this tool? I need to put certain dependencies first…

  • http://www.javascriptkata.com dsimard

    for all configuration options, you can go here : https://github.com/dsimard/rea…

    There's is an *order* options that can be used like that :

    order:["jquery.js", "jquery.ui.js"]

    You don't have to specify every files, just the ones that need to be loaded first. After that, it will be sorted alphabetically.

  • http://www.viget.com Doug Avery

    Ah, I didn't notice that page. Thanks!

  • http://www.javascriptkata.com dsimard

    Because of your comment, I noticed that the page wasn't linked anywhere. I re-worked the wiki : http://github.com/dsimard/read…

  • http://www.viget.com Doug Avery

    I still might be doing it wrong:

    https://github.com/dsimard/rea…

    (edit: Nevermind, was using old version)

  • http://www.nickabusey.com/2011/07/getting-started-with-node/ Getting started with Node – NickABusey.com

    [...] make this even better, add a Git hook, so when you deploy everything is how you want it for production straight from the [...]

  • http://vivecodigo.org/2011/07/15/podcast-6-de-la-temporada-0/ Podcast 6 de la temporada 0 | ViveCodigo – Podcast
  • http://kalzdfscvi.com/ Ycvddf

    2011…

    Hello There. I found your blog using msn. This is a very well written article. I’ll make sure to bookmark it and come back to read more of your useful info. Thanks for the post. I will definitely return….

  • http://www.erealestatelajolla.com La Jolla and San Diego CA Homes For Sale

    http://www.eRealEstateLaJolla.com...

    Search Ca homes for sale using our La Jolla and San Diego MLS real estate search. Receive email updates of Realtor listings with prices and blog for all your San Diego county real estate needs. Whether single-family houses, townhomes, luxury homes, bea…

  • http://kalzggdjsdcvi.com/ dYcxcgcvfgg

    2011…

    I love it when people come together and share opinions, great blog, keep it up….

  • http://www.individualhealthinsurance2.com Individual Health Insurance

    2011…

    I’ve read some good stuff here. Definitely worth bookmarking for revisiting. I surprise how much effort you put to make such a magnificent informative site….

  • http://www.epostmailer.com/epostmailer/ bulk email

    2011…

    I appreciate, cause I found just what I was looking for. You have ended my four day long hunt! God Bless you man. Have a nice day. Bye…

  • http://Blzggzdjsdscvi.com/ dYcbbgx

    2011…

    It’s perfect time to make some plans for the future and it is time to be happy. I have read this post and if I could I wish to suggest you few interesting things or suggestions. Maybe you could write next articles referring to this article. I want to …

  • http://esoftwarereview.info software reviews

    2011…

    Thanks for another fantastic post. Where else could anyone get that kind of info in such an ideal way of writing? I’ve a presentation next week, and I am on the look for such information….

  • http://www.sportspicksnation.com picks for college football

    2011…

    Pretty nice post. I just stumbled upon your weblog and wanted to say that I have truly enjoyed browsing your blog posts. After all I’ll be subscribing to your rss feed and I hope you write again very soon!…

  • http://www.stovergame.org easy shove

    How many followers can be of your blog at blogspot?…

    If I create a blog, at blogspot. How many people can be my followers? Is there any limit of followers for a particular blog?….