{"id":15683605,"url":"https://github.com/doowb/append-buffer","last_synced_at":"2025-04-30T08:21:33.258Z","repository":{"id":23438301,"uuid":"99019811","full_name":"doowb/append-buffer","owner":"doowb","description":"Append a buffer to another buffer ensuring to preserve line ending characters.","archived":false,"fork":false,"pushed_at":"2022-03-26T09:35:05.000Z","size":12,"stargazers_count":10,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-26T09:04:40.512Z","etag":null,"topics":["append","append-buffer","buffer","concat-buffer","concatenation","eol"],"latest_commit_sha":null,"homepage":"https://github.com/doowb/append-buffer","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doowb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-01T16:05:48.000Z","updated_at":"2022-04-12T01:49:48.000Z","dependencies_parsed_at":"2022-07-25T13:32:00.921Z","dependency_job_id":null,"html_url":"https://github.com/doowb/append-buffer","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Fappend-buffer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Fappend-buffer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Fappend-buffer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Fappend-buffer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doowb","download_url":"https://codeload.github.com/doowb/append-buffer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251666680,"owners_count":21624351,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["append","append-buffer","buffer","concat-buffer","concatenation","eol"],"created_at":"2024-10-03T17:07:38.218Z","updated_at":"2025-04-30T08:21:33.237Z","avatar_url":"https://github.com/doowb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 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\u0026label=Travis)](https://travis-ci.org/doowb/append-buffer) [![Windows Build Status](https://img.shields.io/appveyor/ci/doowb/append-buffer.svg?style=flat\u0026label=AppVeyor)](https://ci.appveyor.com/project/doowb/append-buffer)\n\n\u003e Append a buffer to another buffer ensuring to preserve line ending characters.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save append-buffer\n```\n\nInstall with [yarn](https://yarnpkg.com):\n\n```sh\n$ yarn add append-buffer\n```\n\n## Usage\n\n```js\nvar appendBuffer = require('append-buffer');\n```\n\n## API\n\n### [appendBuffer](index.js#L28)\n\nAppend a buffer to another buffer ensuring to preserve line ending characters.\n\n**Params**\n\n* `buf` **{Buffer}**: Buffer that will be used to check for an existing line ending. The suffix is appended to this.\n* `suffix` **{Buffer}**: Buffer that will be appended to the buf.\n* `returns` **{Buffer}**: Final Buffer\n\n**Example**\n\n```js\nconsole.log([appendBuffer(new Buffer('abc\\r\\n'), new Buffer('def')).toString()]);\n//=\u003e [ 'abc\\r\\ndef\\r\\n' ]\n\nconsole.log([appendBuffer(new Buffer('abc\\n'), new Buffer('def')).toString()]);\n//=\u003e [ 'abc\\ndef\\n' ]\n\n// uses os.EOL when a line ending is not found\nconsole.log([appendBuffer(new Buffer('abc'), new Buffer('def')).toString()]);\n//=\u003e [ 'abc\\ndef' ]\n```\n\n## Attribution\n\nThe 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.\n\n## About\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\nPlease read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards.\n\n### Building docs\n\n_(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.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme \u0026\u0026 verb\n```\n\n### Running tests\n\nRunning 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:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n### Author\n\n**Brian Woodward**\n\n* [github/doowb](https://github.com/doowb)\n* [twitter/doowb](https://twitter.com/doowb)\n\n### License\n\nCopyright © 2017, [Brian Woodward](https://doowb.com).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on August 01, 2017._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoowb%2Fappend-buffer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoowb%2Fappend-buffer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoowb%2Fappend-buffer/lists"}