Add process.binding#5160
Closed
SimenB wants to merge 1 commit intofacebook:masterfrom
SimenB:process-binding
Closed
Add process.binding#5160SimenB wants to merge 1 commit intofacebook:masterfrom SimenB:process-binding
SimenB wants to merge 1 commit intofacebook:masterfrom
SimenB:process-binding
Conversation
Contributor
Not really, it's there only for Node.js itself, i.e. it is not a part of public API. Using is causes a lot of problems. |
Contributor
Author
|
I suppose if things like nodejs/node#15776 are done more often, the use-cases will disappear. But with nodejs/node-v0.x-archive#624 closed, getting access to a list of built-in modules is a pain (https://github.com/tapjs/stack-utils/blob/459f196b67b01684f6d370ab774944de184a8cfe/index.js#L16-L28 & https://github.com/sindresorhus/builtin-modules/blob/32ab9f2fe30c1cad2b449d7e6058a1b4018d9b88/index.js#L8-L10). I can agree on them being edge-cases though, and not wanting to make it easier to use/discover |
Contributor
Author
|
Meh, bad practice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It's not documented, but it's there to allow us to access the internal core node C++ bindings.
One common use case is doing
process.bindings('fs').realpathto access the nativerealpathorprocess.bindings('natives')to get a list of all built-in modules in node.(I understand if you don't want to add undocumented functions)