Skip to content

Migration from process.binding  #22064

Closed
Closed
@jdalton

Description

@jdalton

With #22004 landed to doc deprecate process.binding I was encouraged to open an issue related to my use of it. Now is a great time to starting examining what from process.binding can be exposed in a user-friendly way.

In my own experience I've attempted to use (if available and there were no user-facing options) these bindings. My usage fits into these categories

  1. chrome inspector wiring
  2. command-line checks
  3. custom error stack decoration
  4. custom inspection

The API run down as follows:

  • process.binding("config")

    • experimentalREPLAwait (command line checks)
    • experimentalWorker (command line checks)
    • exposeInternals (command line checks)
    • preserveSymlinks (command line checks)
    • preserveSymlinksMain (command line checks)
  • process.binding("inspector")

    • callAndPauseOnStart (inspector wiring; other utils like ndb use this too)
    • consoleCall (inspector wiring)
    • open (only existence checks, much like Node does)
  • process.binding("util")

    • decorated_private_symbol (error stack decoration)
    • getProxyDetails (custom inspection)
    • setHiddenValue (error stack decoration)
    • safeGetenv

For chrome inspector wiring there has been some work to expose things like originalConsole (#21659), but more in this area is needed.

For command-line checks the answer may be to use process.execArgv, but a more config like object form would be handy.

For custom error stack decoration there is early feelers in #21958.

Custom inspection helpers like getProxyDetails/getPromiseDetails and safeGetenv have nothing simmering at the moment.

Updated:

I crossed through API that have user-facing options.

Update:

Replaced process.binding("inspector").open inferences with process.config.variables.v8_enable_inspector checks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    processIssues and PRs related to the process subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions