uid-by-name
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

uid-by-name

This package provides a utility function for retrieving a user's UID by their name. You can also install it globally to make it available as a command.

Install

# With yarn (locally) 
yarn add uid-by-name;
 
# With yarn (globally) 
yarn global add uid-by-name;
 
# With npm (locally) 
npm install uid-by-name;
 
# With npm (globally) 
npm install -g uid-by-name;

Usage

The module returns a single function that accepts a username. It returns the UID if the user exists or undefined otherwise.

With TypeScript / ES modules:

import getUidbyName from "uid-by-name";
 
console.log(getUidByName("some-user"));

With CommonJS:

var getUidbyName = require("uid-by-name");
 
console.log(getUidByName("some-user"));

CLI usage

Once installed globally, the CLI tool accepts any number of usernames as parameters and prints out the UID for each one in a new line. If a user does not exist, an empty line is printed.

uid-by-name some-user some-other-user;

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i uid-by-name

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

3.74 kB

Total Files

8

Last publish

Collaborators

  • gfmio