grp

1.1.0 • Public • Published

grp NPM version

<grp.h> binding for node.

var fs = require('fs');
var grp = require('grp');
 
var stat = fs.statSync(path);
 
var group = grp.getgrgid(stat.gid);
console.log('the group name for "' + path + '" is: ' + group.gr_name);

Installation

$ npm install grp --save

Features

There is two available functions:

  • getgrgid(gid)
    var group = grp.getgrgid(10);
  • getgrnam(name)
    var group = grp.getgrname('wheel');

These functions obtain information from opendirectoryd(8), including records in /etc/group which is described in group(5). Each line of the database is defined by the structure group like found in the include file <grp.h>:

{
    gr_name        /* group name */
    gr_passwd,     /* group password - NOT SUPPORTED IN V1.0.0 */
    gr_gid,        /* group id */
    gr_mem         /* group members - NOT SUPPORTED IN V1.0.0 */
}

More Information

$ man 3 getgrgid

License

MIT

Dependents (0)

Package Sidebar

Install

npm i grp

Weekly Downloads

8

Version

1.1.0

License

MIT

Last publish

Collaborators

  • dabos-gfi