{"_id":"trim-newlines","_rev":"2974375","name":"trim-newlines","description":"Trim newlines from the start and/or end of a string","dist-tags":{"3-0-1":"3.0.1","latest":"5.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2023-06-15T08:25:19.000Z","created":"2015-09-29T09:28:27.741Z","5.0.0":"2023-03-20T17:36:52.010Z","4.1.1":"2023-03-20T17:30:09.698Z","4.1.0":"2023-03-20T17:28:04.701Z","4.0.2":"2021-06-10T16:11:33.568Z","3.0.1":"2021-05-28T16:46:12.397Z","4.0.1":"2021-05-28T16:43:07.930Z","4.0.0":"2021-04-21T11:47:23.274Z","3.0.0":"2019-04-29T04:28:32.845Z","2.0.0":"2017-04-22T13:06:15.702Z","1.0.0":"2015-09-29T09:28:27.741Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/trim-newlines.git"},"versions":{"5.0.0":{"name":"trim-newlines","version":"5.0.0","description":"Trim newlines from the start and/or end of a string","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/trim-newlines.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=14.16"},"scripts":{"test":"xo && ava && tsd"},"keywords":["trim","newline","newlines","linebreak","lf","crlf","left","right","start","end","string","remove","delete","strip"],"devDependencies":{"ava":"^5.2.0","tsd":"^0.28.0","xo":"^0.53.1"},"types":"./index.d.ts","gitHead":"6980540ee683a660fd82cb1bda37bf1ebd989179","bugs":{"url":"https://github.com/sindresorhus/trim-newlines/issues"},"homepage":"https://github.com/sindresorhus/trim-newlines#readme","_id":"trim-newlines@5.0.0","_nodeVersion":"14.21.3","_npmVersion":"9.2.0","dist":{"shasum":"fbe350dc9d5fe15e80793b86c09bc7436a3da383","size":1911,"noattachment":false,"key":"/trim-newlines/-/trim-newlines-5.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/trim-newlines/download/trim-newlines-5.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trim-newlines_5.0.0_1679333811872_0.7567101222604802"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-03-20T17:36:52.010Z","publish_time":1679333812010,"_cnpm_publish_time":1679333812010},"4.1.1":{"name":"trim-newlines","version":"4.1.1","description":"Trim newlines from the start and/or end of a string","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/trim-newlines.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava && tsd"},"keywords":["trim","newline","newlines","linebreak","lf","crlf","left","right","start","end","string","remove","delete","strip"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.14.0","xo":"^0.39.1"},"types":"./index.d.ts","gitHead":"abb78c1e0780e510ccb07fd84e9e3415bf3b8e96","bugs":{"url":"https://github.com/sindresorhus/trim-newlines/issues"},"homepage":"https://github.com/sindresorhus/trim-newlines#readme","_id":"trim-newlines@4.1.1","_nodeVersion":"14.21.3","_npmVersion":"9.2.0","dist":{"shasum":"28c88deb50ed10c7ba6dc2474421904a00139125","size":2029,"noattachment":false,"key":"/trim-newlines/-/trim-newlines-4.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/trim-newlines/download/trim-newlines-4.1.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trim-newlines_4.1.1_1679333409540_0.3643763342005957"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-03-20T17:30:09.698Z","publish_time":1679333409698,"_cnpm_publish_time":1679333409698},"4.1.0":{"name":"trim-newlines","version":"4.1.0","description":"Trim newlines from the start and/or end of a string","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/trim-newlines.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava && tsd"},"keywords":["trim","newline","newlines","linebreak","lf","crlf","left","right","start","end","string","remove","delete","strip"],"devDependencies":{"ava":"^5.2.0","tsd":"^0.28.0","xo":"^0.53.1"},"types":"./index.d.ts","gitHead":"96ffac489de8e5946a31ca324ccfee96800a3603","bugs":{"url":"https://github.com/sindresorhus/trim-newlines/issues"},"homepage":"https://github.com/sindresorhus/trim-newlines#readme","_id":"trim-newlines@4.1.0","_nodeVersion":"14.21.3","_npmVersion":"9.2.0","dist":{"shasum":"6ac0c73b59daef3976c0ec8ebf9a99b16d3905b5","size":2137,"noattachment":false,"key":"/trim-newlines/-/trim-newlines-4.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/trim-newlines/download/trim-newlines-4.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trim-newlines_4.1.0_1679333284540_0.5517642783465395"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-03-20T17:28:04.701Z","publish_time":1679333284701,"_cnpm_publish_time":1679333284701},"4.0.2":{"name":"trim-newlines","version":"4.0.2","description":"Trim newlines from the start and/or end of a string","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/trim-newlines.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava && tsd"},"keywords":["trim","newline","newlines","linebreak","lf","crlf","left","right","start","end","string","remove","delete","strip"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.14.0","xo":"^0.39.1"},"gitHead":"abb78c1e0780e510ccb07fd84e9e3415bf3b8e96","bugs":{"url":"https://github.com/sindresorhus/trim-newlines/issues"},"homepage":"https://github.com/sindresorhus/trim-newlines#readme","_id":"trim-newlines@4.0.2","_nodeVersion":"16.2.0","_npmVersion":"7.10.0","dist":{"shasum":"d6aaaf6a0df1b4b536d183879a6b939489808c7c","size":2027,"noattachment":false,"key":"/trim-newlines/-/trim-newlines-4.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/trim-newlines/download/trim-newlines-4.0.2.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trim-newlines_4.0.2_1623341493396_0.16959373924037946"},"_hasShrinkwrap":false,"publish_time":1623341493568,"_cnpm_publish_time":1623341493568},"3.0.1":{"name":"trim-newlines","version":"3.0.1","description":"Trim newlines from the start and/or end of a string","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/trim-newlines.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["trim","newline","newlines","linebreak","lf","crlf","left","right","start","end","string","remove","delete","strip"],"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"readmeFilename":"readme.md","gitHead":"b10d5f4afef832b16bc56d49fc52c68cbd403869","bugs":{"url":"https://github.com/sindresorhus/trim-newlines/issues"},"homepage":"https://github.com/sindresorhus/trim-newlines#readme","_id":"trim-newlines@3.0.1","_nodeVersion":"12.22.1","_npmVersion":"7.5.4","dist":{"shasum":"260a5d962d8b752425b32f3a7db0dcacd176c144","size":1805,"noattachment":false,"key":"/trim-newlines/-/trim-newlines-3.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/trim-newlines/download/trim-newlines-3.0.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trim-newlines_3.0.1_1622220372278_0.6237785637243509"},"_hasShrinkwrap":false,"publish_time":1622220372397,"_cnpm_publish_time":1622220372397},"4.0.1":{"name":"trim-newlines","version":"4.0.1","description":"Trim newlines from the start and/or end of a string","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/trim-newlines.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava && tsd"},"keywords":["trim","newline","newlines","linebreak","lf","crlf","left","right","start","end","string","remove","delete","strip"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.14.0","xo":"^0.39.1"},"gitHead":"b63718391b436e87fe9b29052c1b9274786e89fa","bugs":{"url":"https://github.com/sindresorhus/trim-newlines/issues"},"homepage":"https://github.com/sindresorhus/trim-newlines#readme","_id":"trim-newlines@4.0.1","_nodeVersion":"12.22.1","_npmVersion":"7.10.0","dist":{"shasum":"caa1a0c92e86282c9cc8485ccd3ee5a6a4fbd958","size":2024,"noattachment":false,"key":"/trim-newlines/-/trim-newlines-4.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/trim-newlines/download/trim-newlines-4.0.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trim-newlines_4.0.1_1622220187784_0.2874199023844335"},"_hasShrinkwrap":false,"publish_time":1622220187930,"_cnpm_publish_time":1622220187930},"4.0.0":{"name":"trim-newlines","version":"4.0.0","description":"Trim newlines from the start and/or end of a string","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/trim-newlines.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava && tsd"},"keywords":["trim","newline","newlines","linebreak","lf","crlf","left","right","start","end","string","remove","delete","strip"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.14.0","xo":"^0.39.1"},"gitHead":"7bd2272fb55d932562aee3ef20b300a02a23377e","bugs":{"url":"https://github.com/sindresorhus/trim-newlines/issues"},"homepage":"https://github.com/sindresorhus/trim-newlines#readme","_id":"trim-newlines@4.0.0","_nodeVersion":"12.22.1","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"34e90776d45f72136ccb5f8a49fbdb4761fb1bc0","size":1942,"noattachment":false,"key":"/trim-newlines/-/trim-newlines-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/trim-newlines/download/trim-newlines-4.0.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trim-newlines_4.0.0_1619005643144_0.004542312065239473"},"_hasShrinkwrap":false,"publish_time":1619005643274,"_cnpm_publish_time":1619005643274},"3.0.0":{"name":"trim-newlines","version":"3.0.0","description":"Trim newlines from the start and/or end of a string","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/trim-newlines.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["trim","newline","newlines","linebreak","lf","crlf","left","right","start","end","string","remove","delete","strip"],"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"bd3309053f8e8795fb1ba7044000e2fd9c763597","bugs":{"url":"https://github.com/sindresorhus/trim-newlines/issues"},"homepage":"https://github.com/sindresorhus/trim-newlines#readme","_id":"trim-newlines@3.0.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"79726304a6a898aa8373427298d54c2ee8b1cb30","size":1724,"noattachment":false,"key":"/trim-newlines/-/trim-newlines-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/trim-newlines/download/trim-newlines-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trim-newlines_3.0.0_1556512112742_0.7758115744914702"},"_hasShrinkwrap":false,"publish_time":1556512112845,"_cnpm_publish_time":1556512112845},"2.0.0":{"name":"trim-newlines","version":"2.0.0","description":"Trim newlines from the start and/or end of a string","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/trim-newlines.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["trim","newline","newlines","linebreak","lf","crlf","left","right","start","end","string","str","remove","delete","strip"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"9db1edbbc6ffe44cb8a11ae7690be6044dfe95c7","bugs":{"url":"https://github.com/sindresorhus/trim-newlines/issues"},"homepage":"https://github.com/sindresorhus/trim-newlines#readme","_id":"trim-newlines@2.0.0","_shasum":"b403d0b91be50c331dfc4b82eeceb22c3de16d20","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.7.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"b403d0b91be50c331dfc4b82eeceb22c3de16d20","size":1578,"noattachment":false,"key":"/trim-newlines/-/trim-newlines-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/trim-newlines/download/trim-newlines-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/trim-newlines-2.0.0.tgz_1492866373755_0.2756255145650357"},"directories":{},"publish_time":1492866375702,"_cnpm_publish_time":1492866375702,"_hasShrinkwrap":false},"1.0.0":{"name":"trim-newlines","version":"1.0.0","description":"Trim newlines from the start and/or end of a string","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/trim-newlines"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["trim","newline","newlines","linebreak","lf","crlf","left","right","start","end","string","str","remove","delete","strip"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"f651a2d4cbf382c2936e6e53edee9316602e4ce7","bugs":{"url":"https://github.com/sindresorhus/trim-newlines/issues"},"homepage":"https://github.com/sindresorhus/trim-newlines","_id":"trim-newlines@1.0.0","_shasum":"5887966bb582a4503a41eb524f7d35011815a613","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"5887966bb582a4503a41eb524f7d35011815a613","size":1610,"noattachment":false,"key":"/trim-newlines/-/trim-newlines-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/trim-newlines/download/trim-newlines-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1443518907741,"_cnpm_publish_time":1443518907741,"_hasShrinkwrap":false}},"readme":"# trim-newlines\n\n> Trim [newlines](https://en.wikipedia.org/wiki/Newline) from the start and/or end of a string\n\nLooking to trim all whitespace, not just newlines? Use `String#trim()`, `String#trimStart()`, or `String#trimEnd()`.\n\n## Install\n\n```sh\nnpm install trim-newlines\n```\n\n## Usage\n\n```js\nimport {trimNewlines, trimNewlinesStart, trimNewlinesEnd} from 'trim-newlines';\n\ntrimNewlines('\\n????\\n????\\r\\n');\n//=> '????\\n????'\n\ntrimNewlinesStart('\\n????\\r\\n');\n//=> '????\\r\\n'\n\ntrimNewlinesEnd('\\n????\\r\\n');\n//=> '\\n????'\n```\n\n## API\n\n### trimNewlines(string)\n\nTrim from the start and end of a string.\n\n### trimNewlinesStart(string)\n\nTrim from the start of a string.\n\n### trimNewlinesEnd(string)\n\nTrim from the end of a string.\n","_attachments":{},"homepage":"https://github.com/sindresorhus/trim-newlines#readme","bugs":{"url":"https://github.com/sindresorhus/trim-newlines/issues"},"license":"MIT"}