From ccabd4a6fa8a6eb79d29bc3bbe9fe2b6531c2d8e Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Mon, 8 Apr 2013 15:13:23 +1000 Subject: [PATCH] process: expose NODE_MODULE_VERSION in process.versions --- doc/api/process.markdown | 17 ++++++++++------- src/node.cc | 2 ++ src/node.h | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/doc/api/process.markdown b/doc/api/process.markdown index c345da7690..d128620e7f 100644 --- a/doc/api/process.markdown +++ b/doc/api/process.markdown @@ -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 diff --git a/src/node.cc b/src/node.cc index 391a17959c..97e64a73b0 100644 --- a/src/node.cc +++ b/src/node.cc @@ -2356,6 +2356,8 @@ Handle 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); diff --git a/src/node.h b/src/node.h index 5769a7b9ce..574a93ac7d 100644 --- a/src/node.h +++ b/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 * other dependencies. */ -#define NODE_MODULE_VERSION 0x000B /* v0.11 */ +#define NODE_MODULE_VERSION 11 #define NODE_STANDARD_MODULE_STUFF \ NODE_MODULE_VERSION, \