Browse Source

process: expose NODE_MODULE_VERSION in process.versions

v0.10.4-release
Rod Vagg 12 years ago
committed by Ben Noordhuis
parent
commit
ccabd4a6fa
  1. 17
      doc/api/process.markdown
  2. 2
      src/node.cc
  3. 2
      src/node.h

17
doc/api/process.markdown

@ -324,13 +324,16 @@ A property exposing version strings of node and its dependencies.
console.log(process.versions); console.log(process.versions);
Will output: Will print something like:
{ node: '0.4.12', { http_parser: '1.0',
v8: '3.1.8.26', node: '0.10.4',
ares: '1.7.4', v8: '3.14.5.8',
ev: '4.4', ares: '1.9.0-DEV',
openssl: '1.0.0e-fips' } uv: '0.10.3',
zlib: '1.2.3',
modules: '11',
openssl: '1.0.1e' }
## process.config ## process.config

2
src/node.cc

@ -2356,6 +2356,8 @@ Handle<Object> SetupProcessObject(int argc, char *argv[]) {
versions->Set(String::NewSymbol("ares"), String::New(ARES_VERSION_STR)); versions->Set(String::NewSymbol("ares"), String::New(ARES_VERSION_STR));
versions->Set(String::NewSymbol("uv"), String::New(uv_version_string())); versions->Set(String::NewSymbol("uv"), String::New(uv_version_string()));
versions->Set(String::NewSymbol("zlib"), String::New(ZLIB_VERSION)); versions->Set(String::NewSymbol("zlib"), String::New(ZLIB_VERSION));
versions->Set(String::NewSymbol("modules"),
String::New(NODE_STRINGIFY(NODE_MODULE_VERSION)));
#if HAVE_OPENSSL #if HAVE_OPENSSL
// Stupid code to slice out the version string. // Stupid code to slice out the version string.
int c, l = strlen(OPENSSL_VERSION_TEXT); int c, l = strlen(OPENSSL_VERSION_TEXT);

2
src/node.h

@ -207,7 +207,7 @@ node_module_struct* get_builtin_module(const char *name);
* an API is broken in the C++ side, including in v8 or * an API is broken in the C++ side, including in v8 or
* other dependencies. * other dependencies.
*/ */
#define NODE_MODULE_VERSION 0x000B /* v0.11 */ #define NODE_MODULE_VERSION 11
#define NODE_STANDARD_MODULE_STUFF \ #define NODE_STANDARD_MODULE_STUFF \
NODE_MODULE_VERSION, \ NODE_MODULE_VERSION, \

Loading…
Cancel
Save