Check for current Node Version

后端 未结 9 1890
温柔的废话
温柔的废话 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:22

    Actually it would be better to use process.versions object which provides a lot of versions for the different node components. Example:

    {
      http_parser: '2.5.2',
      node: '4.4.3',
      v8: '4.5.103.35',
      uv: '1.8.0',
      zlib: '1.2.8',
      ares: '1.10.1-DEV',
      icu: '56.1',
      modules: '46',
      openssl: '1.0.2g'
    }
    

提交回复
热议问题