Class ProcessUtils

A utility class for retrieving user and group information.

Methods

Methods

  • Gets the GID for a given group name.

    Parameters

    • groupName: string

      The group name to look up.

    Returns number

    The GID.

    import {ProcessUtils} from 'nodejs-shared';

    // Get the GID for the user 'ec2-user'. Example: Returns 1000.
    ProcessUtils.getGid('ec2-user');

    If the group name is not found or another error occurs.

  • Gets the UID for a given username.

    Parameters

    • username: string

      The username to look up.

    Returns number

    The UID.

    import {ProcessUtils} from 'nodejs-shared';

    // Get the UID for the user 'ec2-user'. Example: Returns 1000.
    ProcessUtils.getUid('ec2-user');

    If the username is not found or another error occurs.