@aikidosec/firewall
Version:
Zen by Aikido is an embedded Application Firewall that autonomously protects Node.js apps against common and critical attacks, provides rate limiting, detects malicious traffic (including bots), and more.
19 lines (18 loc) • 982 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.warnIfEntrypointIsModule = warnIfEntrypointIsModule;
const colorText_1 = require("./colorText");
const warnBox_1 = require("./warnBox");
const getEntrypointFromCLIArgs_1 = require("./getEntrypointFromCLIArgs");
const looksLikeModuleSyntax_1 = require("./looksLikeModuleSyntax");
function warnIfEntrypointIsModule() {
const entrypoint = (0, getEntrypointFromCLIArgs_1.getEntrypointFromCLIArgs)();
if (!entrypoint) {
return;
}
const looksLikeModule = (0, looksLikeModuleSyntax_1.looksLikeModuleSyntax)(entrypoint);
if (looksLikeModule) {
// oxlint-disable-next-line no-console
console.warn((0, colorText_1.colorText)("red", (0, warnBox_1.warnBox)("Zen is NOT protecting your application. Your entrypoint uses ESM syntax, which requires the new hook system. Setup instructions: https://github.com/AikidoSec/firewall-node/blob/main/docs/esm.md")));
}
}