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?
I'm going to suggest that you write your package in coffeescript, but only publish it in javascript. I do it like this:
srclibsrc is committed to my git repo, lib is in my .gitignorelib is published to npm, src is in my .npmignorecoffee-script package is in my devDependenciesYou can take a look at a simple package of mine, refix, for inspiration:
npm install refix