I have used CoffeeScript for a while. Now I need to write a npm package, can I write it in CoffeeScript, or I should compile CoffeeScript into JavaScript?
You can write NPM modules in coffeescript, but in order for them to be usable by JS users they must be compiled to JS before you publish on NPM.
package.json
makes this easy with their prepublish
script hook which runs the specified script before you publish. Heres an example of a prepublish
NPM hook in zombie.js
https://github.com/assaf/zombie/blob/master/package.json#L16