how to know which javascript version in my NODEJS?

I want to know which javascript version is my NodeJS is supporting ?

Answers


Use process.versions. From that page in the documentation:

console.log(process.versions);

outputs

{ node: '0.4.12',
  v8: '3.1.8.26',
  ares: '1.7.4',
  ev: '4.4',
  openssl: '1.0.0e-fips' }

EDIT: V8 uses the ECMAScript as specified in ECMA-262, 5th edition.

Reference: http://code.google.com/p/v8/


According to its documentation, this command could be used;

node -p process.versions.v8

Not trying to necropost, here -- however, this seems to be the way to accomplish this...it is a bit convoluted, however.

What I did was -- follow the method outlined here and then added some of my own...

node -p process.versions

{ 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' }

Then, it depends on your platform -- I have node running on Windows 10, so...

node --v8-options | find "in progress"

For Linux use...

node --v8-options | grep "in progress"

  --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))

V8 implements ECMAScript as defined in ECMA-262-- I am unaware of any way to relate that to any other 'version', however -- it will tell you what features are still in development.

If you omit the pipe to grep/find, you get a long list of all v8 options available.

Finally, I am not actually developing the Node application for use on my Windows 10 machine -- I am developing the Node application for a Raspberry Pi and using Visual Studio Code to ssh, so -- at my terminal prompt, I ssh into the RPi and use the Linux version above...

node -p process.versions

{ 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' }

node --v8-options | grep "in progress"

--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))

Need Your Help

Xcode - Error creating LLDB target

ios xcode swift lldb beta

I'm getting this error whenever I build in XCode 6 beta 4. It seems to be making my app insanely slow.

Converting WordPress website to Progressive Web App

wordpress progressive-web-apps

I am building a Progressive Web App but there is a very little documentation and support online so far. I am listing down all my questions in this email.