{"_id":"split-text-to-chunks","_rev":"1-8d6583f3cc098cf7e2c4b4a189181ce1","name":"split-text-to-chunks","description":"Split a text string to chunks for e.g. word wrapping","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"split-text-to-chunks","description":"Split a text string to chunks for e.g. word wrapping","version":"1.0.0","repository":{"type":"git","url":"git+https://github.com/srcagency/wrap-words.git"},"bin":{"wordwrap":"cli.js"},"scripts":{"test":"node test"},"dependencies":{"get-stdin":"^5.0.1","minimist":"^1.2.0"},"devDependencies":{"tape":"^4.8.0"},"license":"MIT","gitHead":"d21925aa4500ad5c7ea2ecf8dadad7eab5b847b1","bugs":{"url":"https://github.com/srcagency/wrap-words/issues"},"homepage":"https://github.com/srcagency/wrap-words#readme","_id":"split-text-to-chunks@1.0.0","_npmVersion":"5.4.1","_nodeVersion":"8.4.0","_npmUser":{"name":"thomas-jensen","email":"thomas@src.agency"},"dist":{"integrity":"sha512-HLtEwXK/T4l7QZSJ/kOSsZC0o5e2Xg3GzKKFxm0ZexJXw0Bo4CaEl39l7MCSRHk9EOOL5jT8JIDjmhTtcoe6lQ==","shasum":"9b9bd2b8530e18b09697b1b8ca4485d31608eeb7","tarball":"https://registry.npmjs.org/split-text-to-chunks/-/split-text-to-chunks-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICqCpi298VB2RSgs+iXkV6oXBReUd0iMSggSkd6Vzc/0AiEAysKJJC+tSuUXQmA8FcxfnvTWRqgiPXv9QG2wMKUvIFk="}]},"maintainers":[{"name":"thomas-jensen","email":"thomas@src.agency"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/split-text-to-chunks-1.0.0.tgz_1505771106117_0.3804930583573878"}}},"readme":"# Split text into chunks\n\nPrefers splitting at whitespace characters, but falls back to \"hard wrapping\",\nand obeys existing newlines.\n\n```js\nconst {split,width} = require('split-text-to-chunks')\n\nconst str = 'A lazy 🐶 made a pile of 💩'\n\nsplit(str, 8/*columns*/)\n// -> [ 'A lazy 🐶', 'made a ', 'pile of ', '💩' ]\n\nsplit('A lazy dog', 3)\n// -> [ 'A ', 'laz', 'y ', 'dog' ]\n\nsplit('A lazy\\ndog', 10)\n// -> [ 'A lazy', 'dog' ]\n\nwidth(str)\n// -> 25\n\nwidth(str, 20/* max, stop counting */)\n// -> 20\n\nwidth('one\\ntwo\\nthree')\n// -> 5\n```\n\n```sh\n$ npm i -g split-text-to-chunks\n\n$ printf \"A lazy 🐶 made a pile of 💩\" | wordwrap --columns 8 # default: 80\nA lazy 🐶\nmade a\npile of\n💩\n\n$ printf \"A lazy 🐶\\nmade a pile of 💩\" | wordwrap --width\n16\n```\n","maintainers":[{"name":"thomas-jensen","email":"thomas@src.agency"}],"time":{"modified":"2022-05-18T11:16:34.453Z","created":"2017-09-18T21:45:07.087Z","1.0.0":"2017-09-18T21:45:07.087Z"},"homepage":"https://github.com/srcagency/wrap-words#readme","repository":{"type":"git","url":"git+https://github.com/srcagency/wrap-words.git"},"bugs":{"url":"https://github.com/srcagency/wrap-words/issues"},"license":"MIT","readmeFilename":"README.md"}