Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

get-built-in-node-module.js 448B

123456789101112131415
  1. 'use strict';
  2. var globalThis = require('../internals/global-this');
  3. var IS_NODE = require('../internals/environment-is-node');
  4. module.exports = function (name) {
  5. if (IS_NODE) {
  6. try {
  7. return globalThis.process.getBuiltinModule(name);
  8. } catch (error) { /* empty */ }
  9. try {
  10. // eslint-disable-next-line no-new-func -- safe
  11. return Function('return require("' + name + '")')();
  12. } catch (error) { /* empty */ }
  13. }
  14. };