Skip to content

Commit e8cd54c

Browse files
committed
run verb to generate readme
1 parent 095b3a6 commit e8cd54c

File tree

1 file changed

+80
-5
lines changed

1 file changed

+80
-5
lines changed

README.md

Lines changed: 80 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,95 @@
1-
# append-buffer [![NPM version](https://badge.fury.io/js/append-buffer.svg)](https://npmjs.org/package/append-buffer) [![Build Status](https://travis-ci.org/doowb/append-buffer.svg?branch=master)](https://travis-ci.org/doowb/append-buffer)
1+
# append-buffer [![NPM version](https://img.shields.io/npm/v/append-buffer.svg?style=flat)](https://www.npmjs.com/package/append-buffer) [![NPM monthly downloads](https://img.shields.io/npm/dm/append-buffer.svg?style=flat)](https://npmjs.org/package/append-buffer) [![NPM total downloads](https://img.shields.io/npm/dt/append-buffer.svg?style=flat)](https://npmjs.org/package/append-buffer) [![Linux Build Status](https://img.shields.io/travis/doowb/append-buffer.svg?style=flat&label=Travis)](https://travis-ci.org/doowb/append-buffer) [![Windows Build Status](https://img.shields.io/appveyor/ci/doowb/append-buffer.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/doowb/append-buffer)
22

33
> Append a buffer to another buffer ensuring to preserve line ending characters.
44
5-
## Installation
5+
## Install
6+
7+
Install with [npm](https://www.npmjs.com/):
68

79
```sh
810
$ npm install --save append-buffer
911
```
1012

13+
Install with [yarn](https://yarnpkg.com):
14+
15+
```sh
16+
$ yarn add append-buffer
17+
```
18+
1119
## Usage
1220

1321
```js
1422
var appendBuffer = require('append-buffer');
15-
appendBuffer();
1623
```
1724

18-
## License
25+
## API
26+
27+
### [appendBuffer](index.js#L28)
28+
29+
Append a buffer to another buffer ensuring to preserve line ending characters.
30+
31+
**Params**
32+
33+
* `buf` **{Buffer}**: Buffer that will be used to check for an existing line ending. The suffix is appended to this.
34+
* `suffix` **{Buffer}**: Buffer that will be appended to the buf.
35+
* `returns` **{Buffer}**: Final Buffer
36+
37+
**Example**
38+
39+
```js
40+
console.log([appendBuffer(new Buffer('abc\r\n'), new Buffer('def')).toString()]);
41+
//=> [ 'abc\r\ndef\r\n' ]
42+
43+
console.log([appendBuffer(new Buffer('abc\n'), new Buffer('def')).toString()]);
44+
//=> [ 'abc\ndef\n' ]
45+
46+
// uses os.EOL when a line ending is not found
47+
console.log([appendBuffer(new Buffer('abc'), new Buffer('def')).toString()]);
48+
//=> [ 'abc\ndef' ]
49+
```
50+
51+
## Attribution
52+
53+
The code in this module was originally added in a [PR](https://github.com/jonschlinkert/file-normalize/pull/3) to [file-normalize](https://github.com/jonschlinkert/file-normalize). It has been split out to allow for standalone use cases.
54+
55+
## About
56+
57+
### Contributing
58+
59+
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
60+
61+
Please read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards.
62+
63+
### Building docs
64+
65+
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
66+
67+
To generate the readme, run the following command:
68+
69+
```sh
70+
$ npm install -g verbose/verb#dev verb-generate-readme && verb
71+
```
72+
73+
### Running tests
74+
75+
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
76+
77+
```sh
78+
$ npm install && npm test
79+
```
80+
81+
### Author
82+
83+
**Brian Woodward**
84+
85+
* [github/doowb](https://github.com/doowb)
86+
* [twitter/doowb](https://twitter.com/doowb)
87+
88+
### License
89+
90+
Copyright © 2017, [Brian Woodward](https://doowb.com).
91+
Released under the [MIT License](LICENSE).
92+
93+
***
1994

20-
MIT © [Brian Woodward](https://doowb.com)
95+
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on August 01, 2017._

0 commit comments

Comments
 (0)