就性能、兼容性和可伸缩性而言,哪一个是编译器ECMAScript靶在带有NodeJS的模块中使用的最佳NodeJS?
根据NodeJS ES6 (ECMAScript 2015)的说法是不完全支持的。是否值得使用ES6,或者将目标ES5添加到由类型记录自动生成的相关解决方案中是否更好?
另一方面,现在这些是 in 函数在NodeJS for ES6中:
--harmony-do-expressions (enable "harmony do-expressions" (in progress))
--harmony-class-fields (enable "harmony fields in class literals" (in progress))
--harmony-static-fields (enable "harmony static fields in class literals" (in progress))
--harmony-array-flatten (enable "harmony Array.prototype.flat{ten,Map}" (in progress))
--harmony-locale (enable "Intl.Locale" (in progress))我不知道现在是否需要这些特性,但是对于代码的可维护性来说,这可能不是最好的选择。
发布于 2019-03-06 10:12:09
Node.js 全力支持ECMAScript 2015,除了尾叫优化和ES模块 (带有标志和.mjs扩展的实验支持)。
用Node中的ES5转换为TypeScript是没有意义的,TypeScript没有严格遵循规范,也可能有它的局限性,特别是本地ES6类的扩展。
https://stackoverflow.com/questions/55020049
复制相似问题