2 CoffeeScript = require 'coffee-script'
3 nodeunit = require 'nodeunit'
4 UglifyJS = require 'uglify-js'
6 task 'build', 'build the JavaScript files from CoffeeScript source', build = (cb) ->
7 source = fs.readFileSync 'src/ipaddr.coffee'
8 fs.writeFileSync 'lib/ipaddr.js', CoffeeScript.compile source.toString()
13 task 'test', 'run the bundled tests', (cb) ->
14 nodeunit.reporters.default.run ['test']
16 task 'compress', 'uglify the resulting javascript', (cb) ->
17 result = UglifyJS.minify('lib/ipaddr.js')
18 fs.writeFileSync('ipaddr.min.js', result.code)