{"_id":"@nbsh/buffer-trim","_rev":"1049344","name":"@nbsh/buffer-trim","description":"Removes whitespace and line-terminator characters from buffer edges","dist-tags":{"latest":"5.0.0-next.1","next":"5.0.0-next.1"},"maintainers":[{"name":"rannn505","email":"rannn505@outlook.com"}],"time":{"modified":"2024-09-18T08:11:30.000Z","created":"2020-05-12T00:23:05.604Z","5.0.0-next.1":"2020-05-12T00:23:05.604Z"},"users":{},"author":{"name":"Ran Cohen","email":"rannn505@outlook.com"},"repository":{"type":"git","url":"git+https://github.com/rannn505/node-powershell.git","directory":"packages/buffer-trim"},"versions":{"5.0.0-next.1":{"name":"@nbsh/buffer-trim","version":"5.0.0-next.1","description":"Removes whitespace and line-terminator characters from buffer edges","author":{"name":"Ran Cohen","email":"rannn505@outlook.com"},"homepage":"http://rannn505.github.io/node-powershell/tree/master/buffer-trim#readme","license":"MIT","main":"dist","types":"dist","directories":{"doc":"doc","lib":"lib","test":"test"},"repository":{"type":"git","url":"git+https://github.com/rannn505/node-powershell.git","directory":"packages/buffer-trim"},"scripts":{},"bugs":{"url":"https://github.com/rannn505/node-powershell/issues"},"publishConfig":{"access":"public"},"gitHead":"b2fa4f408d7ed1685f74b068b2018792e98dcd93","_id":"@nbsh/buffer-trim@5.0.0-next.1","_nodeVersion":"10.16.0","_npmVersion":"lerna/3.20.2/node@v10.16.0+x64 (darwin)","dist":{"integrity":"sha512-NQaGV4PJZIQvwJcFeCwK/0MMMOLh302YvYUpcY/8hI38teEBtM66IPMMZvhlOt1x0yV9aaJiYJGrU9kf7PKrAg==","shasum":"00ebccc458e651394fbeb7de32f016735d5b217d","tarball":"http://registry-npm.ywwl.com/@nbsh/buffer-trim/download/@nbsh/buffer-trim-5.0.0-next.1.tgz","fileCount":6,"unpackedSize":5998,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuexpCRA9TVsSAnZWagAAi5wP/RFdVVbOyRsuescYHMF4\nIb74jQgVy9ftg0PDEg4LsIIRsXrS8SmyzzXaOh0MpipROqdaLGzzSE9jEUQy\nRutWicGj3g20FZW5/vbDRfXYMbrNo9szjN4YBUba/+q48ctHoPp4La6Fun4P\ntMvcU/HAcNJq0oMuL3TXu1wAQGkhfo3DRQPR0ocj6FLoMDkjO+p2J1QRTsCE\nofbJq0y9IkwEhUtIMlaflAZB8sCcPz6CEUxCfXt99OVoBY74S9wY/Hj5t1hG\nOCYo4UfvMLKLP9/91ii/NVMwG3Iqux7Bveumn5iE2mPV81ntUxFhteKCgSt9\nMV+GR5LE8A9aOOlL2vdtzIuIulRGgxZagHgLuBvRHFnjF5M7y2TX8V9Bn5re\nxZe0tsCDntbHfE8tMjvMFMKOU1Pw3Pa85Aoy7nWwmQhqMKKJRuRjz+Dn2hDm\nkEtTs4UWTotxz71TSMmJ/DTyABx+kOlSmV0iD9r+uaKtq9P75eWe0phRyFX7\nJuwDC+W4yALRHBO0FtExgz7NBEQJwZeSjpdDqpqfge09wujn3Ieb9J+WP9G2\n5T/TpSVgsodrc2nlHGviduzU0l97PzbwsEIkzpYENht9opgYd7ieTeAdj28p\nZtdnXxEVcTVzfVeeimH4dIJlOdV2cSP5gxJixuqrEbw3k/xr8aPquhuFg3b7\nsiFk\r\n=yo0r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVNxWLHFhQifgUPiYRwcRdxco8SyEceJFyl3bbpvt+WwIgH2M59VcQPDJ6vTxl7N6o3IcMigXhSrzMws8C2pOmYM8="}],"size":2539,"noattachment":false,"key":"/@nbsh/buffer-trim/-/@nbsh/buffer-trim-5.0.0-next.1.tgz"},"maintainers":[{"name":"rannn505","email":"rannn505@outlook.com"}],"_npmUser":{"name":"rannn505","email":"rannn505@outlook.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/buffer-trim_5.0.0-next.1_1589242985494_0.8783630005982412"},"_hasShrinkwrap":false,"publish_time":1589242985604,"_cnpm_publish_time":1589242985604}},"readme":"# `buffer-trim`\n\n> Removes whitespace and line-terminator characters from buffer edges\n\n## Installation\n\n```bash\n$ npm i -S @nbsh/buffer-trim\n$ yarn add @nbsh/buffer-trim\n```\n\n## Usage\n\n```js\nimport { EOL } from 'os';\nimport { trimBufferStart, trimBufferEnd, trimBuffer } from '@nbsh/buffer-trim';\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":"http://rannn505.github.io/node-powershell/tree/master/buffer-trim#readme","bugs":{"url":"https://github.com/rannn505/node-powershell/issues"},"license":"MIT"}