Have ideas to improve npm?Join in the discussion! »

    is-cli

    2.0.0 • Public • Published

    is-cli

    Returns true if the current module was ran directly by node and not imported by another module. This is useful for CLI-style modules that also export values.

    Usage

    npm i is-cli
    const isCLI = require("is-cli")(module);
    // => true

    Will throw when module is absent.

    © silverwind, distributed under BSD licence

    Install

    npm i is-cli

    DownloadsWeekly Downloads

    6

    Version

    2.0.0

    License

    BSD-2-Clause

    Unpacked Size

    2.64 kB

    Total Files

    4

    Last publish

    Collaborators

    • avatar