os-user
Platform aware tool to get the currently logged-in user evaluated using environment variables and falls back to whoami.
Last updated 5 years ago by leichtgewicht .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install os-user 
SYNC missed versions from official npm registry.

os-user Build Status

Simple node.js util that returns the user currently running on the system.

On windows this util is aware of the domain using the USERDOMAIN and USERNAME variable.

On other systems it uses the USER environment variable. If the USER is not given or empty on other systems it will fallback to whoami.

Usage

Install with:

$ npm i os-user --save

and use it with:

var user = require('os-user')
user(function (err, usr) {
    console.log(usr)
})

cheers.

Caching & Invalidation

By default the user is cached for 10 minutes it is possible to invalidate the cache using:

user.invalidate()

License

ISC

first version extracted from osenv

Current Tags

  • 2.1.4                                ...           latest (5 years ago)

8 Versions

  • 2.1.4                                ...           5 years ago
  • 2.1.3                                ...           5 years ago
  • 2.1.2                                ...           5 years ago
  • 2.1.1                                ...           5 years ago
  • 2.1.0                                ...           5 years ago
  • 2.0.1                                ...           5 years ago
  • 2.0.0                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (2)

Copyright 2014 - 2016 © taobao.org |