-
Notifications
You must be signed in to change notification settings - Fork 286
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
npm best practices for using node 4 #8
Comments
Interesting. Thanks for the response. |
@allain what you can do is use a |
I'd suggest sticking with ES5 for the time being, but by all means code in ES6 and use Babel (or similar) to transpile. Consider the target audience when writing something. Even small, agile places may not yet have moved to Node 4.x, and may not want to for a little while yet because of the associated overheads (testing, legacy code etc). My personal view is to use new shiny things for my own stuff, but if I want something to be used by others then to avoid the cutting edge. |
@julianduque I love the npm prepublish hook. Unfortunately, from what I understand this would be run on very npm install, not just npm publish. This means, I think that any users of my package would be forced to install babel, even if the code was precompiled before it was published. Please tell me my understanding is flawed. Thanks |
@allain You are correct that |
I believe I don't believe |
@allain this really depends on what the module is/does and what features you want to use. Many think working with a module transpiled from Since this question was asked about 6 months ago- I'll add to @yosuke-furukawa comment by noting that MANY more features have become available now (see http://node.green). Perhaps whatever you're writing is only applicable to newer apps and you can just publish with the engines property set to a version of node that supports the features you're using. HTH |
closing for now, feel free to reopen. |
I love the ES6 features of Node 4 but I'm concerned that building an npm package using them will annoy users who include it from older Node versions.
How should I handle this?
The text was updated successfully, but these errors were encountered: