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

Commit ccabd4a

Browse files
rvaggbnoordhuis
authored andcommitted
process: expose NODE_MODULE_VERSION in process.versions
1 parent 21f3c5c commit ccabd4a

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

doc/api/process.markdown

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -324,13 +324,16 @@ A property exposing version strings of node and its dependencies.
324324

325325
console.log(process.versions);
326326

327-
Will output:
328-
329-
{ node: '0.4.12',
330-
v8: '3.1.8.26',
331-
ares: '1.7.4',
332-
ev: '4.4',
333-
openssl: '1.0.0e-fips' }
327+
Will print something like:
328+
329+
{ http_parser: '1.0',
330+
node: '0.10.4',
331+
v8: '3.14.5.8',
332+
ares: '1.9.0-DEV',
333+
uv: '0.10.3',
334+
zlib: '1.2.3',
335+
modules: '11',
336+
openssl: '1.0.1e' }
334337

335338
## process.config
336339

src/node.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2356,6 +2356,8 @@ Handle<Object> SetupProcessObject(int argc, char *argv[]) {
23562356
versions->Set(String::NewSymbol("ares"), String::New(ARES_VERSION_STR));
23572357
versions->Set(String::NewSymbol("uv"), String::New(uv_version_string()));
23582358
versions->Set(String::NewSymbol("zlib"), String::New(ZLIB_VERSION));
2359+
versions->Set(String::NewSymbol("modules"),
2360+
String::New(NODE_STRINGIFY(NODE_MODULE_VERSION)));
23592361
#if HAVE_OPENSSL
23602362
// Stupid code to slice out the version string.
23612363
int c, l = strlen(OPENSSL_VERSION_TEXT);

src/node.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ node_module_struct* get_builtin_module(const char *name);
207207
* an API is broken in the C++ side, including in v8 or
208208
* other dependencies.
209209
*/
210-
#define NODE_MODULE_VERSION 0x000B /* v0.11 */
210+
#define NODE_MODULE_VERSION 11
211211

212212
#define NODE_STANDARD_MODULE_STUFF \
213213
NODE_MODULE_VERSION, \

0 commit comments

Comments
 (0)