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

1.0.2 • Public • Published

gid-by-name

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

Install

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

Usage

The module returns a single function that accepts a group name. It returns the GID if the group exists or undefined otherwise.

With TypeScript / ES modules:

import getGidbyName from "gid-by-name";
 
console.log(getGidByName("some-group"));

With CommonJS:

var getGidbyName = require("gid-by-name");
 
console.log(getGidByName("some-group"));

CLI usage

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

gid-by-name some-group some-other-group;

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    2
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i gid-by-name

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

4.05 kB

Total Files

8

Last publish

Collaborators

  • gfmio