Published as a standalone module!
Created
July 6, 2011 23:39
-
-
Save aseemk/1068606 to your computer and use it in GitHub Desktop.
Handler for efficiently caching compiled Coffee and/or Streamline files.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// app-dev.js | |
// Helper script to register CoffeeScript and Streamline extension handlers | |
// before running an app during development. | |
// | |
// Uses https://github.com/aseemk/coffee-streamline for efficient require(), | |
// caching compiled files between runs. Sweet! | |
// | |
// Usage: instead of `_coffee app`, just do `node app-dev app`. | |
// | |
// Also works great w/ node-dev <https://github.com/fgnass/node-dev>: | |
// `node-dev app-dev app`. | |
var Path = require('path'); | |
// remove this script from the node args: | |
process.argv.splice(1, 1); | |
// resolve the location of the main script: | |
var path = Path.resolve(process.cwd(), process.argv[1]); | |
// and run the target script as the main one: | |
require('coffee-streamline').run(path); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment