You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Node has added process.getBuiltinModule(id) to allow synchronous loading of built-in modules: nodejs/node#52762
The idea is that library authors will now more easily be able to create cross runtime libraries that can conditionally load Node APIs only when running in Node:
if(globalThis.process?.getBuiltinModule){// Running in Node.js, use the Node.js fs module.constfs=globalThis.process.getBuiltinModule('fs');}
OpenTelemetry instruments modules via require-in-the-middle and import-in-the-middle but built-in modules loaded via this new API will not be instrumented as it doesn't go through require.
The text was updated successfully, but these errors were encountered:
Node has added
process.getBuiltinModule(id)
to allow synchronous loading of built-in modules:nodejs/node#52762
The idea is that library authors will now more easily be able to create cross runtime libraries that can conditionally load Node APIs only when running in Node:
OpenTelemetry instruments modules via
require-in-the-middle
andimport-in-the-middle
but built-in modules loaded via this new API will not be instrumented as it doesn't go throughrequire
.The text was updated successfully, but these errors were encountered: