{"name":"smartwrap","version":"1.0.10","description":"Textwrap for javascript/nodejs. Correctly handles wide characters (宽字符) and emojis (😃). Automatically breaks long words.","main":"src/main.js","bin":{"smartwrap":"src/terminal-adapter.js"},"scripts":{"test":"grunt t"},"repository":{"type":"git","url":"https://www.github.com/tecfu/smartwrap.git"},"keywords":["wordwrap"],"author":{"name":"tecfu"},"license":"GPL-2.0","dependencies":{"breakword":"^1.0.3","wcwidth":"^1.0.1","yargs":"^8.0.1"},"devDependencies":{"chai":"^4.0.2","grunt":"^1.0.1","grunt-cli":"^1.2.0","grunt-mocha-test":"^0.13.2","mocha":"^3.4.1"},"gitHead":"c4b22641eeac69cc787c347c56cdae3d0465818d","_id":"smartwrap@1.0.10","_npmVersion":"6.1.0","_nodeVersion":"10.6.0","_npmUser":{"name":"tecfu","email":"help@tecfu.com"},"dist":{"integrity":"sha512-S4PF1dIxFcMUP68uxIp7F6Cf0pFCQu8bkjsCmoSXAVAOBe2SUKowlLSxSuEtaUEyQLeY24bMb/YgRZJCfAwlCg==","shasum":"873ef350d4ee1262fed4a80a55634d86ae1faf48","tarball":"http://registry-npm.ywwl.com/smartwrap/download/smartwrap-1.0.10.tgz","fileCount":16,"unpackedSize":52448,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcHLB4CRA9TVsSAnZWagAAe7MP/R91FavVGBL98WGbP1H9\n0dze19shorVglGeNdL/0ezFhkSY2pfbQ/ftrHre4YWXCDhBboChN4L1RrPyq\n1Yiz1Zr4Npz11oo6ttRBQgcw3+wzBQAn8eeEHh8eKqBQbBSJ6gTiWrxyaW4b\nzoalWgCHeDIgGrWYaDVtjBKa9mTaKp7K6sU8gOLoH/RbwLZrz3nhZCACvARA\nYR3CKrX/ZCscsJc/+OoJyqnlmPJa+wEwk6JtfJ/XhDkMYAQ8R4nCkQqkFNPK\nE9Qf4FelA/GiLUyBC0lbjskcY3EBgXU6eyWJWGqzux9hczQ398W1muejUWr7\n/VyUlrCNAb62CTkDONeuJvgIV6WoAOOgjWs4areTBxMUZu481V38KmedmhY7\n2+1glNHEtL/gh0+LNWJBCCYZTfdo/LkiDduCR6ORh8puYAI2k3VGeJ8tvlR1\n3fZdkCvoXrB6LF2S0VO9PeQezNJvOJlH+PSVpXF5LOjV2AjAwrtoVg9huCVA\nRwM3HEzi9nurA4ITOHoybgPs3L1TEXGMzGNRe5zcfn/UA+5PaVD+J8HVInyo\nLaIzVeh/K4D6tVBwZJbictNGefpRMjCz8/d19z+7nPhDNqOOs6QvNNi4IrWF\n1w+W4OtiBPI3dcvxkbSDaiq1T2c3nfhWRY1mWJDYINewwwJs+3fWkHsz1WC4\ngLrA\r\n=gNmk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5JsFVLzQZsMeyLPTet3qg+Kmqtib22hNXJk8qoVnE5QIgD7NUQ1cL5EKHnY2rU1RiSY5Qy2dRrf4yhgaIMWHSQAo="}],"size":18616,"noattachment":false,"key":"/smartwrap/-/smartwrap-1.0.10.tgz"},"maintainers":[{"name":"tecfu","email":"help@tecfu.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/smartwrap_1.0.10_1545384055609_0.2238030026757094"},"_hasShrinkwrap":false,"deprecated":"Backported compatibility to node > 6","readme":"# smartwrap\n\n[![Build Status](https://travis-ci.org/tecfu/smartwrap.svg?branch=master)](https://travis-ci.org/tecfu/smartwrap) [![Dependency Status](https://david-dm.org/tecfu/smartwrap.png)](https://david-dm.org/tecfu/smartwrap) [![NPM version](https://badge.fury.io/js/smartwrap.svg)](http://badge.fury.io/js/smartwrap)\n\nTextwrap for javascript/nodejs. Correctly handles wide characters (宽字符) and emojis (😃). Optionally break words when wrapping strings.\n## Why? \n\nI needed a javascript package to correctly wrap wide characters - which have a \"length\" property value of 1 but occupy 2 or more spaces in the terminal.\n\n## Example Usages:\n\n### Terminal:\n```sh\nnpm i -g smartwrap\necho somestring you want to wrap | smartwrap --width=3 --paddingLeft=1\n```\n\n#### Output:\n```\n so\n me\n st\n ri\n ng\n yo\n u\n wa\n nt\n to\n wr\n ap\n```\n\n## Node module:\n\n### Wide Character Wrapping\n\n```js\nvar Smartwrap = require('smartwrap');\nvar exampleText1 = '宽字符';\nconsole.log(Smartwrap(exampleText1,{\n  width: 2\n}));\n```\n\n- Output:\n```\n宽\n字\n符\n```\n\n### String Wrapping\n\n```js\nlet exampleText2 = \"break at word\"\n\nconsole.log(smartwrap(exampleText2,{\n  width: 10,\n  breakword: false //default\n}))\n```\n\n- Output:\n\n```\nbreak at\nword\n```\n\n### Breaking Words When Wrapping Strings\n\n```js\nconsole.log(smartwrap(exampleText2,{\n  width: 10,\n  breakword: true\n}))\n```\n\n- Output:\n\n```\nbreak at w\nord\n```\n\n## Options\n\n```sh\n--breakword       Choose whether or not to break words when wrapping a string\n                                                                 [default: false]\n--errorChar       Placeholder for wide characters when minWidth < 2\n                                                                 [default: �]\n--minWidth        Never change this unless you are certin you are not using\n                  wide characters and you want a column 1 space wide. Then\n                  change to 1.                   [choices: 1, 2] [default: 2]\n--paddingLeft     Set the left padding of the output             [default: 0]\n--paddingRight    Set the right padding of the output            [default: 0]\n--splitAt         Characters at which to split input    [default: [\" \",\"\\t\"]]\n--trim            Trim the whitespace from end of input       [default: true]\n--width, -w       Set the line width of the output (in spaces)\n                                                     [required] [default: 10]\n```\n\n## Compatibility \n\nnode 6.0 <\n\n## License\n\n[MIT](https://opensource.org/licenses/MIT)\n\n","publish_time":1545384055798,"_cnpm_publish_time":1545384055798,"dist-tags":{"latest":"4.0.0"}}