Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@web/config-loader

Package Overview
Dependencies
Maintainers
6
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@web/config-loader - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

6

CHANGELOG.md
# @web/config-loader
## 0.0.3
### Patch Changes
- 588a971: fix loading esm config on windows
## 0.0.2

@@ -4,0 +10,0 @@

4

package.json
{
"name": "@web/config-loader",
"version": "0.0.2",
"version": "0.0.3",
"publishConfig": {

@@ -39,5 +39,5 @@ "access": "public"

],
"devDependencies": {
"dependencies": {
"semver": "^7.3.2"
}
}

@@ -0,3 +1,7 @@

const semver = require('semver');
const { pathToFileURL} = require('url')
const ConfigLoaderError = require('./ConfigLoaderError');
const supportsEsm = semver.satisfies(process.version, '>=12.17.0');
// These strings may be node-version dependent and need updating over time

@@ -11,13 +15,4 @@ // They're just to display a helpful error message

async function supportsEsm() {
try {
await import(__filename);
} catch (error) {
return false;
}
return true;
}
module.exports = async function importConfig(path) {
if (!(await supportsEsm())) {
if (!supportsEsm) {
throw new ConfigLoaderError(

@@ -31,3 +26,3 @@ 'You are trying to load a config as es module but your version of node does not support it. ' +

try {
const config = await import(path);
const config = await import(pathToFileURL(path));

@@ -34,0 +29,0 @@ if (typeof config.default !== 'object') {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc