Is your feature request related to a problem? Please describe.
When JavaScriptObfuscator.obfuscate() is called in an interactive terminal, it may print an advertisement for JavaScript Obfuscator Pro:
[javascript-obfuscator] 🛡️ JavaScript Obfuscator Pro is now available...
The advertisement is printed even when logging has been explicitly disabled:
const JavaScriptObfuscator = require("javascript-obfuscator");
JavaScriptObfuscator.obfuscate(
"const value = 1;",
{
log: false
}
);
As a library, javascript-obfuscator should not write promotional content to stdout after the caller has explicitly requested no logging. This can pollute build output and interfere with structured or captured logs.
Describe the solution you'd like
At minimum, the advertisement should respect the existing log: false option and produce no output when logging is disabled.
It would also be useful to provide a dedicated opt-out for users who want normal diagnostic logging without promotional messages, for example:
{
log: true,
advertisement: false
}
Describe alternatives you've considered
The advertisement can currently be suppressed indirectly by:
- setting a recognized CI environment variable such as
CI=1;
- running with a non-TTY
stdout;
- waiting until the internal display counter reaches its limit.
However, these are not explicit or discoverable opt-out mechanisms.
Setting CI=1 may change the behavior of unrelated tools in the same build process, redirecting stdout changes output handling, and the display counter resets after its configured period.
Additional context
The advertisement was introduced in v5.0.1 and is still present in v5.6.0.
Internally, the advertisement is emitted through logger.advertise(), which bypasses the existing log option. Therefore, log: false suppresses normal obfuscator messages but not the promotional message.
Thank you for considering an explicit opt-out.
Is your feature request related to a problem? Please describe.
When
JavaScriptObfuscator.obfuscate()is called in an interactive terminal, it may print an advertisement for JavaScript Obfuscator Pro:The advertisement is printed even when logging has been explicitly disabled:
As a library,
javascript-obfuscatorshould not write promotional content tostdoutafter the caller has explicitly requested no logging. This can pollute build output and interfere with structured or captured logs.Describe the solution you'd like
At minimum, the advertisement should respect the existing
log: falseoption and produce no output when logging is disabled.It would also be useful to provide a dedicated opt-out for users who want normal diagnostic logging without promotional messages, for example:
Describe alternatives you've considered
The advertisement can currently be suppressed indirectly by:
CI=1;stdout;However, these are not explicit or discoverable opt-out mechanisms.
Setting
CI=1may change the behavior of unrelated tools in the same build process, redirectingstdoutchanges output handling, and the display counter resets after its configured period.Additional context
The advertisement was introduced in v5.0.1 and is still present in v5.6.0.
Internally, the advertisement is emitted through
logger.advertise(), which bypasses the existinglogoption. Therefore,log: falsesuppresses normal obfuscator messages but not the promotional message.Thank you for considering an explicit opt-out.