Security News
JavaScript Leaders Demand Oracle Release the JavaScript Trademark
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
faster-js-for-node
Advanced tools
This is a tool that is used to optimize which babel plugins should be used to transform es6/7/next features according to the runtime node enviroment and the babel config
A tool is used to optimize which babel plugins should be used to transform es6/7/next features according to the runtime node enviroment and the babel config.
node 有很多版本,4.0.0 以后的版本都开始支持 es2015 的 features。利用 babel 可以将我们的 esnext 代码做适当转换,让其可以运行在 node 上。node 6.5.0 已经支持了 99% 的 es2015 的 features。那么是不是这 99% 的 features 我们就可以不用经过转换直接跑在 node 上了呢?
答案是肯定的,但是我们忽略了一个问题,就是这些代码运行速度如何呢?是不是 esnext 在 node 上跑的速度就比 es5 快呢?目前来看,答案是否定的。这里参考了 alloyteam 的一篇名为 “nodejs support es6 features”(链接见文尾)的文章,其中性能一节就提到了这个问题。当时眼前一亮,感觉这是一个能做出点成果的方向,决定就这个问题做的更深入点。于是就有了这个项目,其目标就是针对不同版本的 node 环境,检测其支持的 esnext 的 features,同时测试这些 features 的运行速度,与 babel 转换的代码的运行速度对比,根据运行速度快慢的对比,给出推荐的 babel plugin 配置选项。
babel: 6.x node: >= 6.5.x
var fasterJS = require('faster-js-for-node');
var res = fasterJS({
babelrc: false,
presets: [
'react',
'es2015',
'stage-0'
],
plugins: [
'transform-runtime',
'transform-object-rest-spread',
'transform-decorators-legacy'
]
});
res.then(ret => {
console.log('recommendedPluginArr', ret.recommendedPluginArr);
console.log('recommenedRemovePluginArr', ret.recommenedRemovePluginArr);
});
FAQs
This is a tool that is used to optimize which babel plugins should be used to transform es6/7/next features according to the runtime node enviroment and the babel config
The npm package faster-js-for-node receives a total of 1 weekly downloads. As such, faster-js-for-node popularity was classified as not popular.
We found that faster-js-for-node demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.