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

    is-root
    TypeScript icon, indicating that this package has built-in type declarations

    3.0.0 • Public • Published

    is-root

    Check if the process is running as root user, for example, one started with sudo

    Install

    $ npm install is-root
    

    Usage

    $ sudo node index.js
    
    // index.js
    import isRoot from 'is-root';
    
    isRoot();
    //=> true

    Related

    • is-elevated - Check if the process is running with elevated privileges (cross-platform)

    Install

    npm i is-root

    DownloadsWeekly Downloads

    5,203,133

    Version

    3.0.0

    License

    MIT

    Unpacked Size

    2.59 kB

    Total Files

    5

    Last publish

    Collaborators

    • avatar