{"_id":"trim-buffer","_rev":"1049291","name":"trim-buffer","description":"Removes whitespace and line-terminator characters from buffer edges","dist-tags":{"latest":"5.0.0","next":"5.0.0-next.3"},"maintainers":[{"name":"rannn505","email":"rannn505@outlook.com"}],"time":{"modified":"2024-09-18T08:10:10.000Z","created":"2021-01-27T02:30:34.367Z","5.0.0":"2021-11-07T19:36:09.623Z","5.0.0-next.3":"2021-01-27T02:30:34.367Z"},"users":{},"author":{"name":"Ran Cohen","email":"rannn505@outlook.com"},"repository":{"type":"git","url":"git+https://github.com/rannn505/child-shell.git","directory":"packages/trim-buffer"},"versions":{"5.0.0":{"name":"trim-buffer","version":"5.0.0","description":"Removes whitespace and line-terminator characters from buffer edges","author":{"name":"Ran Cohen","email":"rannn505@outlook.com"},"homepage":"https://github.com/rannn505/child-shell/tree/master/packages/trim-buffer#readme","license":"MIT","main":"dist","types":"dist","directories":{"doc":"doc","lib":"lib","test":"test"},"repository":{"type":"git","url":"git+https://github.com/rannn505/child-shell.git","directory":"packages/trim-buffer"},"bugs":{"url":"https://github.com/rannn505/child-shell/issues"},"publishConfig":{"access":"public"},"scripts":{},"dependencies":{},"devDependencies":{"@types/node":"^16.11.6"},"gitHead":"53d55fe71982aad3d10dfa2b962554675283f9c9","_id":"trim-buffer@5.0.0","_nodeVersion":"14.18.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-PqdsRmhir3lUwraK/O6sdZ9QcmtUK0c6F1utX/WNquJsL4Jpdck+DSe9Mqy8Wk7uAQD/SlVn6cyGF5bj6VF33Q==","shasum":"3d07d1646fa5b70d60d6f9d73f45747a3dc83e4f","tarball":"http://registry-npm.ywwl.com/trim-buffer/download/trim-buffer-5.0.0.tgz","fileCount":5,"unpackedSize":5369,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2+Q5CRA9TVsSAnZWagAAXTEQAID/zBDCc7dtQKXU2JuM\n1xHYJe/azztvkjYFLx3I+Z6cq9Uqy7zGulK5zdtqrTEVvzVOPTC/rqQJ9qJq\n8gMLkAvGcqt+YISXKChezH0/c932BTpvwvTGSoGjPjfn71O3w2ODqdkxraQr\ntXRD0jTwgW0R11a6RDoNMa0o53rUPpFWGYc8d3Nr9DcWWlFXo9x2lR9cla5J\nagKCZA/PoObfsBH0Aaul/yMFaHx2ikGxSkjnHHwK6Zye98ekURlvhaIZlCSA\nQUtCI5+VQ+NKsuPjTXtNVDVq2rfAKYHyeDRq2UowVOngu6jbXdq7SQwjKMF0\nAWln/7h5jCoOGXyH2GJbPVtO/Rf3MuqweAgegxIdAM1A/mnoQ8e1f+mGsRDY\nFAD+laUBRgAbuiDZvfg+rUMtUm3nlPIJkQxOubjBd2VWHM63bGQCOhqRrXZ4\nN/lpaP4+mGVGL77NNU5CYS6+a+y9uRA8iR2VlmrfT7EWCvhBqAMQJ6I64O7K\nyWf+j/4pR1oqWmo3bNNQNtow9EF2LYsT4gCWZadytWvZD2oQR81HXKVouFA5\nnPLTgc94ZZ4RggqOmLjIdO98ToTVrXFosEvsXu3j8iD/N+oUF8PDbu6qWK0l\nqOB0eEFscgZTIzVyHAnFxGA/8VQGOPGa6yotqrKNVjFhFC1rMjiuwVXZ+zRI\nRrio\r\n=KpDg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDnN20HukRrYXJmEq0wEmM9QUQ7aJIQgUjPy3x9BNdyuwIgcRZJ+7YjqsmnSa/UoqkwLGEN8lEBqNIZUOuQvvNPB1g="}],"size":1895,"noattachment":false,"key":"/trim-buffer/-/trim-buffer-5.0.0.tgz"},"_npmUser":{"name":"rannn505","email":"rannn505@outlook.com"},"maintainers":[{"name":"rannn505","email":"rannn505@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trim-buffer_5.0.0_1636313769493_0.34236949168421793"},"_hasShrinkwrap":false,"publish_time":1636313769623,"_cnpm_publish_time":1636313769623},"5.0.0-next.3":{"name":"trim-buffer","version":"5.0.0-next.3","description":"Removes whitespace and line-terminator characters from buffer edges","author":{"name":"Ran Cohen","email":"rannn505@outlook.com"},"homepage":"https://github.com/rannn505/child-shell/tree/master/packages/trim-buffer#readme","license":"MIT","main":"dist","types":"dist","directories":{"doc":"doc","lib":"lib","test":"test"},"repository":{"type":"git","url":"git+https://github.com/rannn505/child-shell.git","directory":"packages/trim-buffer"},"bugs":{"url":"https://github.com/rannn505/child-shell/issues"},"publishConfig":{"access":"public"},"scripts":{},"devDependencies":{"@types/node":"^13.13.4"},"gitHead":"7badde5984299f245b6a0a188474a14604a83d44","_id":"trim-buffer@5.0.0-next.3","_nodeVersion":"12.20.0","_npmVersion":"lerna/3.22.1/node@v12.20.0+x64 (darwin)","dist":{"integrity":"sha512-Qc23xaIoD4zcOiCBQtjTrEbc7YyeU7H/W8jMNbTbwOeoWcjBzbcGSHSj1MFNKHVfmhKNRy/htI2m+mV9TLPBDw==","shasum":"a7ab09948b17dff39122b2e23a8d04b75a04aa8b","tarball":"http://registry-npm.ywwl.com/trim-buffer/download/trim-buffer-5.0.0-next.3.tgz","fileCount":6,"unpackedSize":6213,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgENBKCRA9TVsSAnZWagAAB/4P+wc5EDn4KJPyWBbcQ0bZ\nSGhbHEnIWVG12nYcZmZbhcfP7df/XUzttPoQc1o7e8kjlLqYmgGbyrg1ZdYA\nPwCkM8a27QuRSxcv8dD536B7cgti+dBYlqPafOY8Z4otuYgvj68AMVnmN1H3\nItbA6VxSGoa9nyOyPvem6ekDVwgY/b4bJ5fprf9Pg0iaC6JXnINAdgzGSUAu\n2DJIO6yF6TqFIqxRA2KZSitJxQojMGtjswZi12RuGlAyhedDYk1mrkrQe9S5\nZl85rGRuNVXj36lxKYQpp35kSff5ctiQmw113Pf37IjSx8cHln9m1Eibmk2m\na4y4+MfYYV7ut6yGItyFgOK5dt1WwakL56nB5FdBaSoiyxx7/lxtCWLL8eJm\n7JhuWUz3fhX45y3JsLWKfX0YdmfIwqTm9Q5pR9D3ybFphodDyFBgywz6HNLP\n5EugjoghyzVZmGdmm4Kgu/FNkIMLlEkzcSzdJjebvUZau9oTiXJAGQX6wx5b\nAed1oVSNbTLnkZFDL2Hl8UGog1eeSPj0yxJR90rC3JNNC8FquFSN/Ctvmd+x\n25rQgVBT0mhUcwN2I/qEJiO/qOspOxwB0rAXErD1/d63u/ZkAwz7gb+uMWHH\nh42LorICc0pJf9nZiVLWd5+1Vwk7V5mb+jO+uPOtS5XeuSlWnUYzChDODV/1\npk+/\r\n=+7bn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG/JHY9v0bEtla+Iox65SJUCEsv5WD0/pw3qBDV5JZrFAiBeAYnsd2b868kwYtJiIbuc7yIIaQKigmP4hNRZk9pTuQ=="}],"size":2554,"noattachment":false,"key":"/trim-buffer/-/trim-buffer-5.0.0-next.3.tgz"},"_npmUser":{"name":"rannn505","email":"rannn505@outlook.com"},"maintainers":[{"name":"rannn505","email":"rannn505@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trim-buffer_5.0.0-next.3_1611714634144_0.3260345991507052"},"_hasShrinkwrap":false,"publish_time":1611714634367,"_cnpm_publish_time":1611714634367}},"readme":"# `trim-buffer`\n\n> Removes whitespace and line-terminator characters from buffer edges\n\n## Installation\n\n```bash\n$ npm i -S trim-buffer\n$ yarn add trim-buffer\n```\n\n## Usage\n\n```js\nimport { EOL } from 'os';\nimport { trimBufferStart, trimBufferEnd, trimBuffer } from 'trim-buffer';\n\nconst trimmable = Buffer.from(` trimme${EOL}`); // Buffer(8) [32, 116, 114, 105, 109, 109, 101, 10]\ntrimBufferStart(trimmable); // Buffer(7) [116, 114, 105, 109, 109, 101, 10]\ntrimBufferEnd(trimmable); // Buffer(7) [32, 116, 114, 105, 109, 109, 101]\ntrimBuffer(trimmable); // Buffer(6) [116, 114, 105, 109, 109, 101]\n```\n\n## API\n\n> Whitespace in this context is all the whitespace characters (space, tab, no-break space, etc.) and all the line terminator characters (LF, CR, etc.).\n\n### `trimBufferStart(buffer: Buffer): Buffer`\n\nThe `trimBufferStart()` method return the buffer stripped of whitespace from its left end. `trimBufferStart()` do not affect the value of the buffer itself.\nExactly what [String.prototype.trimStart()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimStart) does, just for buffers.\n\n### `trimBufferEnd(buffer: Buffer): Buffer`\n\nThe `trimBufferEnd()` method return the buffer stripped of whitespace from its right end. `trimBufferEnd()` do not affect the value of the buffer itself.\nExactly what [String.prototype.trimEnd()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimEnd) does, just for buffers.\n\n### `trimBuffer(buffer: Buffer): Buffer`\n\nThe `trimBuffer()` method return the buffer stripped of whitespace both ends. `trimBuffer()` do not affect the value of the buffer itself.\nExactly what [String.prototype.trim()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim) does, just for buffers.\n","_attachments":{},"homepage":"https://github.com/rannn505/child-shell/tree/master/packages/trim-buffer#readme","bugs":{"url":"https://github.com/rannn505/child-shell/issues"},"license":"MIT"}