{"name":"smartwrap","version":"1.0.11","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":"git+https://github.com/tecfu/smartwrap.git"},"keywords":["wordwrap"],"author":{"name":"tecfu"},"license":"GPL-2.0","dependencies":{"breakword":"^1.0.3","wcwidth":"^1.0.1","yargs":"^12.0.5"},"devDependencies":{"chai":"^4.2.0","grunt":"^1.0.3","grunt-cli":"^1.3.2","grunt-mocha-test":"^0.13.3","mocha":"^5.2.0"},"gitHead":"f6369b48ffd13a3a0b76fdedc334cef509fb8245","bugs":{"url":"https://github.com/tecfu/smartwrap/issues"},"homepage":"https://github.com/tecfu/smartwrap#readme","_id":"smartwrap@1.0.11","_npmVersion":"6.5.0","_nodeVersion":"10.6.0","_npmUser":{"name":"tecfu","email":"help@tecfu.com"},"dist":{"integrity":"sha512-Pa/Vl0SjKM0Lf1ovLsRIUhXwS2nJbir0dmfQyEq696NeEpbAyduIVPTfjcnTbpM4IepUh6LvQMbApfXXccmviQ==","shasum":"ee8f85878bfac89c1fa4da33e0877f729a8e2a74","tarball":"http://registry-npm.ywwl.com/smartwrap/download/smartwrap-1.0.11.tgz","fileCount":15,"unpackedSize":43444,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOuB7CRA9TVsSAnZWagAA9l8P/0PoZX6IpEU0SsfKBVco\nXks0egEb12D9tGqoPkr5dIEed4yu0WICqwuR9PWeGnLEDzfVSoQxwtt3CzjI\ne2HYgyYyYTKzIlSaAZbzFCW1axxVa2cZP3GK0e6hA+ssOcQi6vacz0XWxcwK\npd3yPypZDOZhV8z/hDXg6PrZRVIDvWIVgtGMTWXkB5VwwpZ/347jk7hSgvsq\n/mRJWaQpVu5QtmCgcYqInTk6phfXLVF6V6nycXaZf2TIWzGS+uWE4w8bsHdV\nwnG9QBUsQhdIJ8Mqrsyy/pYEtmLq1LrjmpChIcZh6IHEXM0wqw8xU6l8QaA6\nkDYwxqTJmWsEJ08p0C/gzo74S1mHRRoVwGxeyIGQYp90dBXQgr+gIvpWHO1H\neQVxn4WWU7leisYhl1GBlPwWW/5OJBBZJQnyaGNiqkwg3Z1oysnyVYRrVGvk\n5PRdy9848VwLlOX4F7SKc9BS0viPwTWX9rR9hqfLfAn5cmLb9aitfYLVpiXQ\nlqmqXxhbLfySIiVrdcej46M7lU0g7nhQBpk1T4bURYDVcA85NPeFwVzqQYqj\nWQ/Xt/M+thNZOycrMB9/Zc1HtOCyUjTVKX4ktYAo9TxQtlO0hVv9sHKImDV8\nuekkZypF+PoLdO076Dvt28bRXpPiDcWEZHKlnygR5fklXIziomGlkDDiHX0x\n6v70\r\n=yz5D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDuB7QTwrJ7KyUh6Xy146G4f8++Y0OEV5vXec8t74x58wIgeg56jSbk/HcBUTUg/z7Elif7NPKP5HhDtvch1JQTqek="}],"size":15207,"noattachment":false,"key":"/smartwrap/-/smartwrap-1.0.11.tgz"},"maintainers":[{"name":"tecfu","email":"help@tecfu.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/smartwrap_1.0.11_1547362427293_0.29489819440435694"},"_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":1547362427424,"_cnpm_publish_time":1547362427424,"dist-tags":{"latest":"4.0.0"}}