@node-red/registry
Advanced tools
Comparing version 2.2.2 to 2.2.3
@@ -14,2 +14,3 @@ // This module handles the management of modules required by the runtime and flows. | ||
const url = require("url"); | ||
const { createRequire } = require("module"); | ||
@@ -143,6 +144,11 @@ const BUILTIN_MODULES = require('module').builtinModules; | ||
const moduleDir = path.join(externalModuleDir,"node_modules",module); | ||
// To handle both CJS and ESM we need to resolve the module to the | ||
// specific file that is loaded when the module is required/imported | ||
// As this won't be on the natural module search path, we use createRequire | ||
// to access the module | ||
const modulePath = createRequire(moduleDir).resolve(module) | ||
// Import needs the full path to the module's main .js file | ||
// It also needs to be a file:// url for Windows | ||
const moduleFile = url.pathToFileURL(require.resolve(moduleDir)); | ||
return import(moduleFile); | ||
const moduleUrl = url.pathToFileURL(modulePath); | ||
return import(moduleUrl); | ||
} | ||
@@ -149,0 +155,0 @@ |
{ | ||
"name": "@node-red/registry", | ||
"version": "2.2.2", | ||
"version": "2.2.3", | ||
"license": "Apache-2.0", | ||
@@ -19,3 +19,3 @@ "main": "./lib/index.js", | ||
"dependencies": { | ||
"@node-red/util": "2.2.2", | ||
"@node-red/util": "2.2.3", | ||
"clone": "2.1.2", | ||
@@ -22,0 +22,0 @@ "fs-extra": "10.0.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
136262
3373
23514
+ Added@node-red/util@2.2.3(transitive)
- Removed@node-red/util@2.2.2(transitive)
Updated@node-red/util@2.2.3