Skip to content

Allow disabling the Pro advertisement and respect log: false #1448

Description

@Bald-guy69

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions