Check for current Node Version

后端 未结 9 1869
温柔的废话
温柔的废话 2021-01-31 06:48

I need to programmatically access the current node version running in a library I am writing. Can\'t seem to find this in the docs.

9条回答
  •  失恋的感觉
    2021-01-31 07:29

    If you access node js running environments, there are 2 main entries: (one simeple, one detail)

    • process.version will give you:

    'v10.16.0'

    • process.versions will give you:
    { http_parser: '2.8.0',
      node: '10.16.0',
      v8: '6.8.275.32-node.52',
      uv: '1.28.0',
      zlib: '1.2.11',
      brotli: '1.0.7',
      ares: '1.15.0',
      modules: '64',
      nghttp2: '1.34.0',
      napi: '4',
      openssl: '1.1.1b',
      icu: '64.2',
      unicode: '12.1',
      cldr: '35.1',
      tz: '2019a' }
    

提交回复
热议问题