Created
July 28, 2011 16:53
-
-
Save brianleroux/1111936 to your computer and use it in GitHub Desktop.
pls make this better
This file contains hidden or 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
// seems the coffee method run is the way to go but I was using it wrong (I think) | |
require('fs').readFile('app.coffee', function(err, code) { | |
// anyhow, this works but is certianly not ideal | |
eval(require('coffee-script').compile(code.toString('utf8'))) | |
}) | |
// also: I do *not* want a compile ceremony leaving .js detritus all over my project if possible! |
nooooo! it makes the src tree so fucking fugly!
Why don't you just write server.js
in coffeescript? In my limited experience, if you wanna use coffeescript, you should use it for all your js files in a single project.
cuz the place(s) I'm deploying doesn't support the coffee cmd unless I provision their servers which I'd prefer to avoid --- I'm being laaaazy
I think a strong case could be made for node platforms to do this for you :)
the case is all in the nasty snippet above! =)
Why not just do this?
require("coffee-script")
require("./server.coffee")
@brianleroux I think you found your answer :)
Holy webscale batman! I had no idea coffeescript could be required into node after it had been required in. Thx @izs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
+1 for compile ceremony before git push. sorry.