node/lib/internal/test/binding.js
Antoine du Hamel 983e9222ca lib: expose primordials object
Expose the internal `primordials` object to help with Node.js core
development.

```console
$ node --expose-internals -r internal/test/binding lib/fs.js
(node:5299) internal/test/binding: These APIs are for internal testing
only. Do not use them.
(Use `node --trace-warnings ...` to show where the warning was created)
```

PR-URL: https://github.com/nodejs/node/pull/36872
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-01-18 11:43:32 +01:00

13 lines
298 B
JavaScript

'use strict';
process.emitWarning(
'These APIs are for internal testing only. Do not use them.',
'internal/test/binding');
if (module.isPreloading) {
globalThis.internalBinding = internalBinding;
globalThis.primordials = primordials;
}
module.exports = { internalBinding, primordials };