{"_id":"passwd-user","_rev":"2763950","name":"passwd-user","description":"Get the passwd user entry from a username or user identifier (UID)","dist-tags":{"latest":"4.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2022-02-14T08:03:40.000Z","created":"2014-04-28T12:20:47.790Z","4.0.0":"2021-11-04T13:13:38.070Z","3.0.0":"2019-05-01T06:58:34.283Z","2.1.0":"2016-06-01T06:14:41.371Z","2.0.0":"2016-01-10T17:30:41.300Z","1.2.1":"2015-07-16T00:09:49.235Z","1.2.0":"2015-06-05T18:03:13.383Z","1.1.1":"2015-03-09T11:38:22.824Z","1.1.0":"2015-02-18T06:22:18.956Z","1.0.1":"2014-11-10T13:27:34.925Z","1.0.0":"2014-08-26T00:14:25.937Z","0.1.0":"2014-04-28T12:20:47.790Z"},"users":{"ivangaravito":true,"rocket0191":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/passwd-user.git"},"versions":{"4.0.0":{"name":"passwd-user","version":"4.0.0","description":"Get the passwd user entry from a username or user identifier (UID)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/passwd-user.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["passwd","linux","macos","osx","uid","gid","pw","getpwuid","posix","unix","shell","home","dir","username","user","etc","password","passwords","identifier"],"dependencies":{"execa":"^5.1.1"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.18.0","xo":"^0.46.4"},"types":"./index.d.ts","gitHead":"c8e442a0f5ab563c60d785bb48e12df80d782bc3","bugs":{"url":"https://github.com/sindresorhus/passwd-user/issues"},"homepage":"https://github.com/sindresorhus/passwd-user#readme","_id":"passwd-user@4.0.0","_nodeVersion":"12.22.1","_npmVersion":"8.1.0","dist":{"shasum":"426d2deef874fc036deb1dc2d21434b0d7b94c27","size":3009,"noattachment":false,"key":"/passwd-user/-/passwd-user-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/passwd-user/download/passwd-user-4.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/passwd-user_4.0.0_1636031617945_0.5458595231259147"},"_hasShrinkwrap":false,"publish_time":1636031618070,"_cnpm_publish_time":1636031618070,"_cnpmcore_publish_time":"2021-12-16T22:33:00.349Z"},"3.0.0":{"name":"passwd-user","version":"3.0.0","description":"Get the passwd user entry from a username or user identifier (UID)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/passwd-user.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["passwd","linux","macos","osx","uid","gid","pw","getpwuid","posix","unix","shell","home","dir","username","user","etc","password","passwords","identifier"],"dependencies":{"execa":"^1.0.0"},"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"3b011c15a43202f14b2dde1db64e35f90dcaed29","bugs":{"url":"https://github.com/sindresorhus/passwd-user/issues"},"homepage":"https://github.com/sindresorhus/passwd-user#readme","_id":"passwd-user@3.0.0","_nodeVersion":"8.16.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"cb164c7cec4636ecbdffeb6ba369bf109654b068","size":3141,"noattachment":false,"key":"/passwd-user/-/passwd-user-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/passwd-user/download/passwd-user-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/passwd-user_3.0.0_1556693914168_0.15346295368597906"},"_hasShrinkwrap":false,"publish_time":1556693914283,"_cnpm_publish_time":1556693914283,"_cnpmcore_publish_time":"2021-12-16T22:33:00.612Z"},"2.1.0":{"name":"passwd-user","version":"2.1.0","description":"Get the passwd user entry from a username or uid","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/passwd-user.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["passwd","linux","osx","uid","gid","pw","getpwuid","posix","unix","shell","home","dir","username","user","etc","password","passwords"],"dependencies":{"execa":"^0.4.0","pify":"^2.3.0"},"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"gitHead":"0f758c9f92fc2d6e56bb56abeee73b4cb94ed664","bugs":{"url":"https://github.com/sindresorhus/passwd-user/issues"},"homepage":"https://github.com/sindresorhus/passwd-user#readme","_id":"passwd-user@2.1.0","_shasum":"fad9db6ae252f8b088e0c5decd20a7da0c5d9f1e","_from":".","_npmVersion":"2.15.0","_nodeVersion":"4.4.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"fad9db6ae252f8b088e0c5decd20a7da0c5d9f1e","size":2691,"noattachment":false,"key":"/passwd-user/-/passwd-user-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/passwd-user/download/passwd-user-2.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/passwd-user-2.1.0.tgz_1464761679058_0.5705063343048096"},"directories":{},"publish_time":1464761681371,"_hasShrinkwrap":false,"_cnpm_publish_time":1464761681371,"_cnpmcore_publish_time":"2021-12-16T22:33:00.809Z"},"2.0.0":{"name":"passwd-user","version":"2.0.0","description":"Get the passwd user entry from a username or uid","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/passwd-user"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["passwd","linux","osx","uid","gid","pw","getpwuid","posix","unix","shell","home","dir","username","user","etc","password","passwords"],"dependencies":{"execa":"^0.2.1","pify":"^2.3.0"},"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"gitHead":"09cc55af4d8d0a94885ce318cd3993d44ef7aa44","bugs":{"url":"https://github.com/sindresorhus/passwd-user/issues"},"homepage":"https://github.com/sindresorhus/passwd-user","_id":"passwd-user@2.0.0","_shasum":"a041db61345b91dc6925de025e29a2713c2796e3","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.2.4","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"a041db61345b91dc6925de025e29a2713c2796e3","size":2621,"noattachment":false,"key":"/passwd-user/-/passwd-user-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/passwd-user/download/passwd-user-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1452447041300,"_hasShrinkwrap":false,"_cnpm_publish_time":1452447041300,"_cnpmcore_publish_time":"2021-12-16T22:33:01.023Z"},"1.2.1":{"name":"passwd-user","version":"1.2.1","description":"Get the passwd user entry from a username or uid","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/passwd-user"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js"],"keywords":["passwd","linux","osx","uid","gid","pw","getpwuid","posix","unix","shell","home","dir","username","user","etc","password","passwords"],"dependencies":{"exec-file-sync":"^2.0.0"},"devDependencies":{"mocha":"*"},"gitHead":"81fd63ac1abb524e3c4cb03c18e7f0ea8097c740","bugs":{"url":"https://github.com/sindresorhus/passwd-user/issues"},"homepage":"https://github.com/sindresorhus/passwd-user","_id":"passwd-user@1.2.1","_shasum":"a01a5dc639ef007dc56364b8178569080ad3a7b8","_from":".","_npmVersion":"2.11.2","_nodeVersion":"0.12.5","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"a01a5dc639ef007dc56364b8178569080ad3a7b8","size":2563,"noattachment":false,"key":"/passwd-user/-/passwd-user-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/passwd-user/download/passwd-user-1.2.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1437005389235,"_hasShrinkwrap":false,"_cnpm_publish_time":1437005389235,"_cnpmcore_publish_time":"2021-12-16T22:33:01.276Z"},"1.2.0":{"name":"passwd-user","version":"1.2.0","description":"Get the passwd user entry from a username or uid","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/passwd-user"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js"],"keywords":["passwd","linux","osx","uid","gid","pw","getpwuid","posix","unix","shell","home","dir","username","user","etc","password","passwords"],"dependencies":{"exec-file-sync":"^1.0.0"},"devDependencies":{"mocha":"*"},"gitHead":"2ca9e846e8acb8df179dc91815b9c88ccb3046c4","bugs":{"url":"https://github.com/sindresorhus/passwd-user/issues"},"homepage":"https://github.com/sindresorhus/passwd-user","_id":"passwd-user@1.2.0","_shasum":"5f60ee247209cb0b432092844d0fd5fc184e9c42","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"5f60ee247209cb0b432092844d0fd5fc184e9c42","size":2559,"noattachment":false,"key":"/passwd-user/-/passwd-user-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/passwd-user/download/passwd-user-1.2.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1433527393383,"_hasShrinkwrap":false,"_cnpm_publish_time":1433527393383,"_cnpmcore_publish_time":"2021-12-16T22:33:01.478Z"},"1.1.1":{"name":"passwd-user","version":"1.1.1","description":"Get the passwd user entry from a username or uid","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/passwd-user"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js"],"keywords":["passwd","linux","osx","uid","gid","pw","getpwuid","posix","unix","shell","home","dir","username","user","etc","password","passwords"],"dependencies":{"sync-exec":"^0.5.0"},"devDependencies":{"mocha":"*"},"gitHead":"94e4c786cde7e4712287db6b6f9667505034576a","bugs":{"url":"https://github.com/sindresorhus/passwd-user/issues"},"homepage":"https://github.com/sindresorhus/passwd-user","_id":"passwd-user@1.1.1","_shasum":"3f19f7c400b8c8c890530752b86184886791db16","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"3f19f7c400b8c8c890530752b86184886791db16","size":1941,"noattachment":false,"key":"/passwd-user/-/passwd-user-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/passwd-user/download/passwd-user-1.1.1.tgz"},"directories":{},"publish_time":1425901102824,"_hasShrinkwrap":false,"_cnpm_publish_time":1425901102824,"_cnpmcore_publish_time":"2021-12-16T22:33:01.710Z"},"1.1.0":{"name":"passwd-user","version":"1.1.0","description":"Get the passwd user entry from a username or uid","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/passwd-user"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js"],"keywords":["passwd","linux","osx","uid","gid","pw","getpwuid","posix","unix","shell","home","dir","username","user","etc","password","passwords"],"dependencies":{"sync-exec":"^0.4.0"},"devDependencies":{"mocha":"*"},"gitHead":"d656096ba96998c8f33aa7c9456025d5f770d9d8","bugs":{"url":"https://github.com/sindresorhus/passwd-user/issues"},"homepage":"https://github.com/sindresorhus/passwd-user","_id":"passwd-user@1.1.0","_shasum":"9917138ed7c02871924069981b87bb53b5113bb5","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"9917138ed7c02871924069981b87bb53b5113bb5","size":2628,"noattachment":false,"key":"/passwd-user/-/passwd-user-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/passwd-user/download/passwd-user-1.1.0.tgz"},"directories":{},"publish_time":1424240538956,"_hasShrinkwrap":false,"_cnpm_publish_time":1424240538956,"_cnpmcore_publish_time":"2021-12-16T22:33:01.886Z"},"1.0.1":{"name":"passwd-user","version":"1.0.1","description":"Get the passwd user entry from a username or uid","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/passwd-user"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js"],"keywords":["passwd","linux","osx","uid","gid","pw","getpwuid","posix","unix","shell","home","dir","username","user","etc","password","passwords"],"dependencies":{"sync-exec":"^0.4.0"},"devDependencies":{"mocha":"*"},"gitHead":"cd9a4018a3d6d0a8876bef45763d31ac1ee466a0","bugs":{"url":"https://github.com/sindresorhus/passwd-user/issues"},"homepage":"https://github.com/sindresorhus/passwd-user","_id":"passwd-user@1.0.1","_shasum":"14efb4f5e62865ab3f9a7407e7bde9766d989ba0","_from":".","_npmVersion":"2.1.5","_nodeVersion":"0.10.32","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"14efb4f5e62865ab3f9a7407e7bde9766d989ba0","size":1878,"noattachment":false,"key":"/passwd-user/-/passwd-user-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/passwd-user/download/passwd-user-1.0.1.tgz"},"directories":{},"publish_time":1415626054925,"_hasShrinkwrap":false,"_cnpm_publish_time":1415626054925,"_cnpmcore_publish_time":"2021-12-16T22:33:02.089Z"},"1.0.0":{"name":"passwd-user","version":"1.0.0","description":"Get the passwd user entry from a username or uid","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/passwd-user"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js"],"keywords":["passwd","linux","osx","uid","gid","pw","getpwuid","posix","unix","shell","home","dir","username","user","etc","password","passwords"],"dependencies":{"sync-exec":"^0.3.2"},"devDependencies":{"mocha":"*"},"bugs":{"url":"https://github.com/sindresorhus/passwd-user/issues"},"homepage":"https://github.com/sindresorhus/passwd-user","_id":"passwd-user@1.0.0","_shasum":"69d991076c8680572479cccf7fab23124521c98c","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"69d991076c8680572479cccf7fab23124521c98c","size":1876,"noattachment":false,"key":"/passwd-user/-/passwd-user-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/passwd-user/download/passwd-user-1.0.0.tgz"},"directories":{},"publish_time":1409012065937,"_hasShrinkwrap":false,"_cnpm_publish_time":1409012065937,"_cnpmcore_publish_time":"2021-12-16T22:33:02.289Z"},"0.1.0":{"name":"passwd-user","version":"0.1.0","description":"Get the passwd user entry from a username or uid","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/passwd-user"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js"],"keywords":["passwd","uid","gid","pw","getpwuid","posix","unix","shell","home","dir","username","user","etc","password","passwords"],"devDependencies":{"mocha":"*"},"bugs":{"url":"https://github.com/sindresorhus/passwd-user/issues"},"homepage":"https://github.com/sindresorhus/passwd-user","_id":"passwd-user@0.1.0","dist":{"shasum":"fbfd0ea16fe6a042bd2d8ed3210296791ecaae99","size":1363,"noattachment":false,"key":"/passwd-user/-/passwd-user-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/passwd-user/download/passwd-user-0.1.0.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1398687647790,"_hasShrinkwrap":false,"_cnpm_publish_time":1398687647790,"_cnpmcore_publish_time":"2021-12-16T22:33:02.704Z"}},"readme":"# passwd-user\n\n> Get the [passwd](https://en.wikipedia.org/wiki/Passwd) user entry from a username or [user identifier (UID)](https://en.wikipedia.org/wiki/User_identifier_(Unix))\n\nWorks on macOS and Linux. See [`user-info`](https://github.com/sindresorhus/user-info) if you need cross-platform support.\n\n## Install\n\n```sh\nnpm install passwd-user\n```\n\n## Usage\n\n```js\nimport {passwdUser} from 'passwd-user';\n\nconsole.log(await passwdUser('sindresorhus'));\n/*\n{\n\tusername: 'sindresorhus',\n\tpassword: '*',\n\tuserIdentifier: 501,\n\tgroupIdentifier: 20,\n\tfullName: 'Sindre Sorhus',\n\thomeDirectory: '/home/sindresorhus',\n\tshell: '/bin/zsh'\n}\n*/\n\nawait passwdUser(501);\nconsole.log('Got entry for user 501');\n\nconst user = await passwdUser();\nconsole.log(`Got entry for user ${user.userIdentifier}`);\n```\n\n## API\n\nReturns an object with:\n\n- `username`\n- `password`\n- `userIdentifier`: [UID](https://en.wikipedia.org/wiki/User_identifier)\n- `groupIdentifier`: [GID](https://en.wikipedia.org/wiki/Group_identifier)\n- `fullName`: Name of user\n- `homeDirectory`: Home directory\n- `shell`: Default shell\n\n### passwdUser(username?)\n### passwdUser(userIdentifier?)\n\nReturns a `Promise<object>` with the user entry.\n\n### passwdUserSync(username?)\n### passwdUserSync(userIdentifier?)\n\nReturns an `object` with the user entry.\n\n#### username\n\nType: `string`\n\nThe username to look up.\n\n#### userIdentifier\n\nType: `number`\\\nDefault: [`process.getuid()`](https://nodejs.org/api/process.html#process_process_getuid) (The current user)\n\nThe [user identifier (UID)](https://en.wikipedia.org/wiki/User_identifier) to look up.\n\n## Related\n\n- [username](https://github.com/sindresorhus/username) - Get the user's username *(cross-platform)*\n- [fullname](https://github.com/sindresorhus/fullname) - Get the user's fullname *(cross-platform)*\n","_attachments":{},"homepage":"https://github.com/sindresorhus/passwd-user#readme","bugs":{"url":"https://github.com/sindresorhus/passwd-user/issues"},"license":"MIT"}