{ "_id": "strip-final-newline", "name": "strip-final-newline", "dist-tags": { "latest": "2.0.0" }, "versions": { "2.0.0": { "name": "strip-final-newline", "version": "2.0.0", "description": "Strip the final newline character from a string/buffer", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/strip-final-newline.git" }, "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=6" }, "scripts": { "test": "xo && ava" }, "keywords": [ "strip", "trim", "remove", "delete", "final", "last", "end", "file", "newline", "linebreak", "character", "string", "buffer" ], "devDependencies": { "ava": "^0.25.0", "xo": "^0.23.0" }, "gitHead": "51c93d6c8683d9fd1cacdb32f2afebac9a1155a1", "bugs": { "url": "https://github.com/sindresorhus/strip-final-newline/issues" }, "homepage": "https://github.com/sindresorhus/strip-final-newline#readme", "_id": "strip-final-newline@2.0.0", "_npmVersion": "6.4.1", "_nodeVersion": "10.12.0", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "dist": { "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "shasum": "89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad", "tarball": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", "fileCount": 4, "unpackedSize": 3046, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb1XUbCRA9TVsSAnZWagAADe4QAIKfZKKn8CFHig0M8lfl\nZWkRAV+2dJAbhILvIrrCYcIZC3A8ICj5GwY5ujeKev8hqkxDe+VfRQRylDTn\nUXCLYMbpV+197qpQb7X6Wdu8ISfIE/zQpBqbGReK/ddJKFHQaIIRG0VWSqWm\nP6R0ICgQPAbMBZ8nYjBjRNvgiseqMwlyxXj1hNKuAR404dGDVIhSzwmg4vku\nmp4FOCDptmFvA/mSzOE/Ochwcdz2wQd6PLtHmCIHzLEvl2z8J4Qaagxwi8yn\neZtQs3B8xtNCKaXOZQYcOMAqZxC4dMGzIEqW3CX9Me9y2p1lHbws55uvNVcX\nHh88Y6/05jr6L6N19ZULpPv9bb5FUcHAOHZFvLhhAl9eQ2WxkZV0IYub5QT7\ngHfcTadB8Mqmw0y58qDwomMLcOXVTwhQYi22OnjTg8pIRq+bfHJzOSgnK7Aa\n464iiikCjO7hG9OfPlpiWdibmFzj8WEsEkzMs6Zeb3uMw6fS8UXTkYLQPzoc\nEtAtOx6PtyKg5Ajl4xlIt4cA24hzsnJs6lJOD89Pd+VIJwihKltOgvOtPN3q\nQ4d2o7S/Ea+e4wIPs6ls4ZWUs5vB7TRQWfrOAeANGxuUSWT+7foTMFBSpOXe\nvxVGokKs1tlzCcbGvew1ZIe+b7RcDbSBr1RwZEo9U41ETveKELS33/Y7oeeL\n2j7u\r\n=W7iG\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/strip-final-newline_2.0.0_1540715802035_0.22560465362477622" }, "_hasShrinkwrap": false } }, "time": { "created": "2018-10-28T08:36:42.035Z", "2.0.0": "2018-10-28T08:36:42.180Z", "modified": "2018-10-28T08:36:45.052Z" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "description": "Strip the final newline character from a string/buffer", "homepage": "https://github.com/sindresorhus/strip-final-newline#readme", "keywords": [ "strip", "trim", "remove", "delete", "final", "last", "end", "file", "newline", "linebreak", "character", "string", "buffer" ], "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/strip-final-newline.git" }, "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "bugs": { "url": "https://github.com/sindresorhus/strip-final-newline/issues" }, "license": "MIT", "readme": "# strip-final-newline [![Build Status](https://travis-ci.com/sindresorhus/strip-final-newline.svg?branch=master)](https://travis-ci.com/sindresorhus/strip-final-newline)\n\n> Strip the final [newline character](https://en.wikipedia.org/wiki/Newline) from a string/buffer\n\nCan be useful when parsing the output of, for example, `ChildProcess#execFile`, as [binaries usually output a newline at the end](https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline). Normally, you would use `stdout.trim()`, but that would also remove newlines at the start and whitespace.\n\n\n## Install\n\n```\n$ npm install strip-final-newline\n```\n\n\n## Usage\n\n```js\nconst stripFinalNewline = require('strip-final-newline');\n\nstripFinalNewline('foo\\nbar\\n\\n');\n//=> 'foo\\nbar\\n'\n\nstripFinalNewline(Buffer.from('foo\\nbar\\n\\n')).toString();\n//=> 'foo\\nbar\\n'\n```\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n", "readmeFilename": "readme.md" }