Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
process: expose NODE_MODULE_VERSION in process.versions
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg authored and bnoordhuis committed Apr 8, 2013
1 parent 21f3c5c commit ccabd4a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
17 changes: 10 additions & 7 deletions doc/api/process.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,16 @@ A property exposing version strings of node and its dependencies.

console.log(process.versions);

Will output:

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

{ http_parser: '1.0',
node: '0.10.4',
v8: '3.14.5.8',
ares: '1.9.0-DEV',
uv: '0.10.3',
zlib: '1.2.3',
modules: '11',
openssl: '1.0.1e' }

## process.config

Expand Down
2 changes: 2 additions & 0 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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("uv"), String::New(uv_version_string()));
versions->Set(String::NewSymbol("zlib"), String::New(ZLIB_VERSION));
versions->Set(String::NewSymbol("modules"),
String::New(NODE_STRINGIFY(NODE_MODULE_VERSION)));
#if HAVE_OPENSSL
// Stupid code to slice out the version string.
int c, l = strlen(OPENSSL_VERSION_TEXT);
Expand Down
2 changes: 1 addition & 1 deletion src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
* other dependencies.
*/
#define NODE_MODULE_VERSION 0x000B /* v0.11 */
#define NODE_MODULE_VERSION 11

#define NODE_STANDARD_MODULE_STUFF \
NODE_MODULE_VERSION, \
Expand Down

0 comments on commit ccabd4a

Please sign in to comment.