From 246346074fed80dea00953dbc919f1dee87597f1 Mon Sep 17 00:00:00 2001 From: Ben Baryo Date: Sun, 13 Oct 2024 16:44:12 +0300 Subject: [PATCH] Finish ESM refactoring --- bin/obfuscation-detector.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/obfuscation-detector.js b/bin/obfuscation-detector.js index 6ca36ac..26f15ba 100755 --- a/bin/obfuscation-detector.js +++ b/bin/obfuscation-detector.js @@ -1,8 +1,9 @@ #!/usr/bin/env node import fs from 'node:fs'; -const detectObfuscation = require(__dirname + '/../src'); +import {fileURLToPath} from 'node:url'; +import {detectObfuscation} from './../src/index.js'; -if (require.main === module) { +if (process.argv[1] === fileURLToPath(import.meta.url)) { try { const args = process.argv.slice(2); if (args.length) {