npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@opendrives/getent

v0.3.0

Published

Get entries from administrative databases for Node.js

Downloads

38

Readme

node-getent

Get entries from administrative databases for Node.js.

It's Node.js implementation of the features in the getent system command.

Why use system calls and not read filesystem?

Some systems don't use files like /etc/passwd.

For example if you are using a LDAP-based systems you must use standard system calls.

By using calls you don't need to bother what type of database the system is currently using.

Install

You can install it using NPM: npm install getent

Features

Currently supports only these database:

  • passwd

TODO

Generic stuff to do:

  • Write unit tests
  • Setup travis-ci

Implement these new databases:

  • Database passwd - Implement getpwnam and getpwuid -- Current search does NOT use these!
  • Database group - Implement getgrent etc
  • Database hosts - Implement gethostent
  • Database services - Implement getservent
  • Database protocols - Implement getprotoent etc
  • Database networks - Implement getnetent

Also maybe these (which were not documented for getent command):

  • Database shadow - Implement getspent, getspnam, etc
  • Database alias - Implement getaliasent etc
  • Database rpc - Implement getrpcent etc
  • Database tty - Implement getttyent etc
  • Database mnt - Implement getmntent

If this library some day has more features than the original command, then it should have runnable node-getent when installed globally.

Feel free to submit issues if you would like to see another feature or would need one of these implemented sooner. I'll accept pull requests, too!

Examples

First you must define getent like this (did you expect something else?):

var getent = require('getent');

Fetch all users using a callback:

getent.passwd(function(user) {
	console.log( JSON.stringify(user) );
});

Fetch all users by returning an array:

var users = getent.passwd();

Fetch single user:

var users = getent.passwd("root");

Fetch two users:

var users = getent.passwd(["root", "nobody"]);

Commercial Support

You can buy commercial support from Sendanor.