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

es-main

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es-main - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

8

main.js

@@ -16,4 +16,10 @@ import {fileURLToPath} from 'url';

const modulePath = fileURLToPath(meta.url);
const scriptPath = process.argv[1];
return stripExt(modulePath) === stripExt(scriptPath);
const extension = path.extname(scriptPath);
if (extension) {
return modulePath === scriptPath;
}
return stripExt(modulePath) === scriptPath;
}

10

package.json
{
"name": "es-main",
"version": "1.0.1",
"version": "1.0.2",
"description": "Test if an ES module is run directly (require.main replacement)",

@@ -16,6 +16,6 @@ "main": "main.js",

"pretest": "eslint .",
"test:with-extension": "node --no-warnings test.js",
"test:without-extension": "node --no-warnings test",
"test:without-node": "NODE_NO_WARNINGS=1 ./test.js",
"test": "npm-run-all test:*"
"test:with-extension": "node test.js",
"test:without-extension": "node test",
"test:without-node": "./test.js",
"test": "NODE_NO_WARNINGS=1 npm-run-all test:*"
},

@@ -22,0 +22,0 @@ "keywords": [

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