如何知道NODEJS中的哪个javascript版本?
我想知道我的NodeJS支持哪个javascript版本?使用。 从文档中的该页:如何知道NODEJS中的哪个javascript版本?,javascript,node.js,version,v8,Javascript,Node.js,Version,V8,我想知道我的NodeJS支持哪个javascript版本?使用。 从文档中的该页: console.log(process.versions); 输出 { node: '0.4.12', v8: '3.1.8.26', ares: '1.7.4', ev: '4.4', openssl: '1.0.0e-fips' } { http_parser: '2.8.0', node: '11.2.0', **v8: '7.0.276.38-node.11'**, uv:
console.log(process.versions);
输出
{ node: '0.4.12',
v8: '3.1.8.26',
ares: '1.7.4',
ev: '4.4',
openssl: '1.0.0e-fips' }
{ http_parser: '2.8.0',
node: '11.2.0',
**v8: '7.0.276.38-node.11'**,
uv: '1.23.2',
zlib: '1.2.11',
ares: '1.15.0',
modules: '67',
nghttp2: '1.34.0',
napi: '3',
openssl: '1.1.0i',
icu: '63.1',
unicode: '11.0',
cldr: '34.0',
tz: '2018e' }
--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-await-optimization (enable "harmony await taking 1 tick" (in progress))
--harmony-locale (enable "Intl.Locale" (in progress))
--harmony-intl-list-format (enable "Intl.ListFormat" (in progress))
--harmony-intl-relative-time-format (enable "Intl.RelativeTimeFormat" (in progress))
{ http_parser: '2.8.0',
node: '8.11.3',
v8: '6.2.414.54',
uv: '1.19.1',
zlib: '1.2.11',
ares: '1.10.1-DEV',
modules: '57',
nghttp2: '1.32.0',
napi: '3',
openssl: '1.0.2o',
icu: '60.1',
unicode: '10.0',
cldr: '32.0',
tz: '2017c' }
--harmony_array_prototype_values (enable "harmony Array.prototype.values" (in progress))
--harmony_function_sent (enable "harmony function.sent" (in progress))
--harmony_do_expressions (enable "harmony do-expressions" (in progress))
--harmony_class_fields (enable "harmony public fields in class literals" (in progress))
--harmony_promise_finally (enable "harmony Promise.prototype.finally" (in progress))
--harmony_number_format_to_parts (enable "Intl.NumberFormat.prototype.formatToParts" (in progress))
--harmony_plural_rules (enable "Intl.PluralRules" (in progress))
编辑:
V8使用ECMA-262第5版中指定的ECMAScript
参考:根据its,可以使用此命令
node -p process.versions.v8
不想在这里发帖——然而,这似乎是实现这一点的方法……然而,这有点复杂 我所做的是——遵循这里概述的方法,然后添加一些我自己的 节点-p进程。版本
{ node: '0.4.12',
v8: '3.1.8.26',
ares: '1.7.4',
ev: '4.4',
openssl: '1.0.0e-fips' }
{ http_parser: '2.8.0',
node: '11.2.0',
**v8: '7.0.276.38-node.11'**,
uv: '1.23.2',
zlib: '1.2.11',
ares: '1.15.0',
modules: '67',
nghttp2: '1.34.0',
napi: '3',
openssl: '1.1.0i',
icu: '63.1',
unicode: '11.0',
cldr: '34.0',
tz: '2018e' }
--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-await-optimization (enable "harmony await taking 1 tick" (in progress))
--harmony-locale (enable "Intl.Locale" (in progress))
--harmony-intl-list-format (enable "Intl.ListFormat" (in progress))
--harmony-intl-relative-time-format (enable "Intl.RelativeTimeFormat" (in progress))
{ http_parser: '2.8.0',
node: '8.11.3',
v8: '6.2.414.54',
uv: '1.19.1',
zlib: '1.2.11',
ares: '1.10.1-DEV',
modules: '57',
nghttp2: '1.32.0',
napi: '3',
openssl: '1.0.2o',
icu: '60.1',
unicode: '10.0',
cldr: '32.0',
tz: '2017c' }
--harmony_array_prototype_values (enable "harmony Array.prototype.values" (in progress))
--harmony_function_sent (enable "harmony function.sent" (in progress))
--harmony_do_expressions (enable "harmony do-expressions" (in progress))
--harmony_class_fields (enable "harmony public fields in class literals" (in progress))
--harmony_promise_finally (enable "harmony Promise.prototype.finally" (in progress))
--harmony_number_format_to_parts (enable "Intl.NumberFormat.prototype.formatToParts" (in progress))
--harmony_plural_rules (enable "Intl.PluralRules" (in progress))
然后,这取决于您的平台--我的节点运行在Windows 10上,所以
节点——v8选项|查找“正在进行中”
对于Linux使用
节点——v8选项| grep“正在进行”
V8实现了ECMA-262中定义的ECMAScript——我不知道有什么方法可以将其与任何其他“版本”联系起来——它将告诉您哪些功能仍在开发中
如果省略grep/find的管道,则会得到一个包含所有可用v8选项的长列表
最后,我并没有实际开发在Windows 10机器上使用的节点应用程序——我正在为Raspberry Pi开发节点应用程序,并使用Visual Studio代码进行ssh,因此——在终端提示下,我将ssh转换为RPi并使用上面的Linux版本
节点-p进程。版本
{ node: '0.4.12',
v8: '3.1.8.26',
ares: '1.7.4',
ev: '4.4',
openssl: '1.0.0e-fips' }
{ http_parser: '2.8.0',
node: '11.2.0',
**v8: '7.0.276.38-node.11'**,
uv: '1.23.2',
zlib: '1.2.11',
ares: '1.15.0',
modules: '67',
nghttp2: '1.34.0',
napi: '3',
openssl: '1.1.0i',
icu: '63.1',
unicode: '11.0',
cldr: '34.0',
tz: '2018e' }
--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-await-optimization (enable "harmony await taking 1 tick" (in progress))
--harmony-locale (enable "Intl.Locale" (in progress))
--harmony-intl-list-format (enable "Intl.ListFormat" (in progress))
--harmony-intl-relative-time-format (enable "Intl.RelativeTimeFormat" (in progress))
{ http_parser: '2.8.0',
node: '8.11.3',
v8: '6.2.414.54',
uv: '1.19.1',
zlib: '1.2.11',
ares: '1.10.1-DEV',
modules: '57',
nghttp2: '1.32.0',
napi: '3',
openssl: '1.0.2o',
icu: '60.1',
unicode: '10.0',
cldr: '32.0',
tz: '2017c' }
--harmony_array_prototype_values (enable "harmony Array.prototype.values" (in progress))
--harmony_function_sent (enable "harmony function.sent" (in progress))
--harmony_do_expressions (enable "harmony do-expressions" (in progress))
--harmony_class_fields (enable "harmony public fields in class literals" (in progress))
--harmony_promise_finally (enable "harmony Promise.prototype.finally" (in progress))
--harmony_number_format_to_parts (enable "Intl.NumberFormat.prototype.formatToParts" (in progress))
--harmony_plural_rules (enable "Intl.PluralRules" (in progress))
节点——v8选项| grep“正在进行”
运行以下脚本:
try {
var k = new Map();
console.log("ES6 supported!!")
} catch(err) {
console.log("ES6 not supported :(")
}
try {
var k = new HashMap();
console.log("ES100 supported!!")
} catch(err) {
console.log("ES100 not supported :(")
}
英特尔最好、最详细的版本在。它按JavaScript版本显示NodeJS版本的矩阵。JavaScript项包括标准名称和每个js特性。节点版本包括V8版本(悬停在节点列标题上)。这些版本都没有描述JS的实现版本。V8引擎的版本不是OP想要的吗?我已经编辑了答案以添加JS版本。我正在寻找NODEJS支持的Javascript版本,NODEJS手册中的一些链接都指向[@DSK,如果你想知道的话,这些链接都是针对Mozilla自己的产品开发的(Gecko、SpiderMonkey等)除了一些遗留版本之外,它们实际上与Google的V8或NodeJ无关。ECMAScript 5.1是:“JavaScript标准是ECMAScript。截至2012年,所有现代浏览器都完全支持ECMAScript 5.1。”但是我怎么知道V8版本使用的是哪个JavaScript版本呢?差不多10年后,你找到了实现这一点的好方法吗?这应该是公认的答案。