Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
trusktr opened this issue Nov 19, 2012 · 4 comments
Open

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

trusktr opened this issue Nov 19, 2012 · 4 comments

Comments

@trusktr
Copy link

trusktr commented Nov 19, 2012

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
Copy link
Author

trusktr commented Nov 19, 2012

I installed coffeescript and got it working.

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

@trusktr trusktr closed this as completed Nov 19, 2012
@rdrey
Copy link

rdrey commented Nov 19, 2012

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
Copy link
Author

trusktr commented Nov 19, 2012

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 trusktr reopened this Nov 19, 2012
@CarlQLange
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants