• Adds a new user.

    Parameters

    • user: {
          groups?: string[];
          home?: string;
          name?: string;
          password?: string;
          primaryGroup?: string;
          shell?: {
              isCustom: boolean;
              isShellObj: boolean;
              name: string;
              path: string;
          };
          user: string;
      }

      The user details.

      • Optional groups?: string[]
      • Optional home?: string
      • Optional name?: string
      • Optional password?: string
      • Optional primaryGroup?: string
      • Optional shell?: {
            isCustom: boolean;
            isShellObj: boolean;
            name: string;
            path: string;
        }
        • isCustom: boolean
        • isShellObj: boolean
        • name: string
        • path: string
      • user: string
    • existingUsers: string[]

      A list of existing usernames.

    Returns Promise<{
        error: string;
        message?: undefined;
        success: boolean;
    } | {
        error?: undefined;
        message: string;
        success: boolean;
    }>

    • Success or error message.