jocafa / node-term-ui

UI toolkit for node.js console apps
60 stars 8 forks source link

How does this work? Keep getting errors... #2

Open trusktr opened 11 years ago

trusktr commented 11 years ago

I keep getting "Unexpected String" errors...

I think it's because I'm not (and don't know how to be) using CoffeeScript...

Can you make it compatible with pure JavaScript? Or provide basic instructions on how to use CoffeeScipt with the package?

Thanks!

trusktr commented 11 years ago

I installed coffeescript and got it working.

Could you please make this not depend on CoffeeScript though, or is that too much trouble?

rdrey commented 11 years ago

I came here from your stackoverflow question.

A npm package should have a main file that's javascript. That file could be a simple "runner.js" that requires coffeescript and converts the .coffee source dynamically. Most other coffeescript projects in npm make coffeescript a dev-dependency and simply ship both, a .js and a .coffee source.

If the npm package can't run in a non-coffee project that is definitely an issue and means that it doesn't belong in npm.

trusktr commented 11 years ago

I was able to make it run by doing running coffee --compile on it, but then, like mentioned on stackoverflow, the package is not require()able the normal way. I agree with what you're saying about making coffeescript a dependency, etc. Ideally, when the user writes var foo = require("coffeeModule");, the module should be compiled automatically the first time it's run if it hasn't been compiled already. That way users don't have to know CoffeeScript even exists and the module just works.

CarlQLange commented 11 years ago

This is fixed in the latest master, commit 1d24cc5. :cake: