I want to compile coffeescript from my Mac OSX app, but I'm unsure how to go about doing this. It seems like node tasks are heavily dependent on other libraries installed to the system. How can I go about compiling coffeescript files from my app?
Asked
Active
Viewed 90 times
0
-
What have you tried so far? For example, have you tried to [launch the `coffee` command from Cocoa App](http://stackoverflow.com/questions/412562/execute-a-terminal-command-from-a-cocoa-app)? What was the outcome? Any error message? – Sylvain Leroux Aug 20 '14 at 08:59
-
So I tried packaging the coffee command inside my app, but it says "node not found". I started including node binaries and that had more dependencies and it just felt like the wrong way to go about this. I could use the one in my user path, but then it would only work for users with coffeescript installed on their system. – msfeldstein Aug 20 '14 at 22:02
-
And by "including the binaries" i meant copying them directly into my xcode bundle. If there's a proper way to pacakage up node scripts into cocoa apps that's what im looking for. – msfeldstein Aug 20 '14 at 22:03
1 Answers
0
A couple ideas:
- The 'Try Coffeescript' section on coffeescript.org compiles in the browser by including the coffeescript compiler as a javascript tag. You could do something like that in a UIKit WebView where you have control over the javascript execution.
- PhoneGap/Codova based app
- Make a request out to a node server or other js environment and return the compiled code via service call.
I'm not sure you've provided enough context for which one of these might work, but they are the first things that come to mind.

Jed Schneider
- 14,085
- 4
- 35
- 46