node-term-ui icon indicating copy to clipboard operation
node-term-ui copied to clipboard

How does this work? Keep getting errors...

Open trusktr opened this issue 13 years ago • 4 comments

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 avatar Nov 19 '12 08:11 trusktr

I installed coffeescript and got it working.

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

trusktr avatar Nov 19 '12 09:11 trusktr

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.

rdrey avatar Nov 19 '12 13:11 rdrey

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.

trusktr avatar Nov 19 '12 14:11 trusktr

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

CarlQLange avatar Apr 08 '13 17:04 CarlQLange