aboutsummaryrefslogtreecommitdiff
path: root/node_modules/parse-passwd/README.md
blob: 31b1e794f0dcd4d569413af08209cfc6516d1523 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# parse-passwd [![NPM version](https://img.shields.io/npm/v/parse-passwd.svg?style=flat)](https://www.npmjs.com/package/parse-passwd) [![NPM downloads](https://img.shields.io/npm/dm/parse-passwd.svg?style=flat)](https://npmjs.org/package/parse-passwd) [![Linux Build Status](https://img.shields.io/travis/doowb/parse-passwd.svg?style=flat&label=Travis)](https://travis-ci.org/doowb/parse-passwd) [![Windows Build Status](https://img.shields.io/appveyor/ci/doowb/parse-passwd.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/doowb/parse-passwd)

> Parse a passwd file into a list of users.

## Install

Install with [npm](https://www.npmjs.com/):

```sh
$ npm install --save parse-passwd
```

## Usage

```js
var parse = require('parse-passwd');
```

## API

**Example**

```js
// assuming '/etc/passwd' contains:
// doowb:*:123:123:Brian Woodward:/Users/doowb:/bin/bash
console.log(parse(fs.readFileSync('/etc/passwd', 'utf8')));

//=> [
//=>   {
//=>     username: 'doowb',
//=>     password: '*',
//=>     uid: '123',
//=>     gid: '123',
//=>     gecos: 'Brian Woodward',
//=>     homedir: '/Users/doowb',
//=>     shell: '/bin/bash'
//=>   }
//=> ]
```

**Params**

* `content` **{String}**: Content of a passwd file to parse.
* `returns` **{Array}**: Array of user objects parsed from the content.

## About

### Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

Please read the [contributing guide](contributing.md) for avice on opening issues, pull requests, and coding standards.

### Building docs

_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_

To generate the readme and API documentation with [verb](https://github.com/verbose/verb):

```sh
$ npm install -g verb verb-generate-readme && verb
```

### Running tests

Install dev dependencies:

```sh
$ npm install -d && npm test
```

### Author

**Brian Woodward**

* [github/doowb](https://github.com/doowb)
* [twitter/doowb](http://twitter.com/doowb)

### License

Copyright © 2016, [Brian Woodward](https://github.com/doowb).
Released under the [MIT license](LICENSE).

***

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on October 19, 2016._