Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: document process.versions.modules #9901

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion doc/api/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -1651,7 +1651,9 @@ added: v0.2.0
* {Object}

The `process.versions` property returns an object listing the version strings of
Node.js and its dependencies.
Node.js and its dependencies. In addition, `process.versions.modules` indicates
the current ABI version, which is increased whenever a C++ API changes. Node.js
will refuse to load native modules built for an older `modules` value.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: This sounds like Node will load native modules built for newer modules values, which isn’t the case… maybe something like for a different fits better?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node/src/node_version.h

Lines 46 to 52 in e03ee71

/**
* When this version number is changed, node.js will refuse
* to load older modules. This should be done whenever
* an API is broken in the C++ side, including in v8 or
* other dependencies.
*/
#define NODE_MODULE_VERSION 51 /* Node.js v7.0.0 */

Documentation text mirrors the only available documentation for this property.... an in-source comment. @addaleax are you saying the comment is wrong?

If so, this PR should change both the comment and the docs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sam-github No, I didn’t say the current text is wrong. It’s just incomplete and might therefore be misleading.

If so, this PR should change both the comment and the docs.

No objections to that, but, like, this isn’t worth holding up the PR or anything imho.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, so text should be something like "Node.js will refuse to load modules that weren't compiled against its own
module ABI number."


```js
console.log(process.versions);
Expand Down