{"name":"smartwrap","version":"1.1.2","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","lint":"eslint src/*","lint-fix":"eslint src/* --fix"},"repository":{"type":"git","url":"git+https://github.com/tecfu/smartwrap.git"},"keywords":["wordwrap"],"author":{"name":"tecfu"},"license":"GPL-2.0","dependencies":{"breakword":"^1.0.5","wcwidth":"^1.0.1","yargs":"^14.2.0"},"devDependencies":{"chai":"^4.2.0","eslint":"^6.6.0","grunt":"^1.0.4","grunt-cli":"^1.3.2","grunt-mocha-test":"^0.13.3","mocha":"^5.2.0"},"gitHead":"864c6c6f87633e0e3a565b83829bbe0856e5c1c2","bugs":{"url":"https://github.com/tecfu/smartwrap/issues"},"homepage":"https://github.com/tecfu/smartwrap#readme","_id":"smartwrap@1.1.2","_nodeVersion":"12.9.1","_npmVersion":"6.10.2","dist":{"integrity":"sha512-x9xniYhFlbuwe7PkPlhVOT+hSvMtQNMsPl6mD5Q34Bti15/KUaqQcPa+8ce2qbPuVE3UhR5qYYoMEuESdrO+DQ==","shasum":"4cd43df96a6faadeeffb4a57ae1d20933f4a34db","tarball":"http://registry-npm.ywwl.com/smartwrap/download/smartwrap-1.1.2.tgz","fileCount":15,"unpackedSize":42232,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdvxUaCRA9TVsSAnZWagAAuzUQAIEgspFrh9+mHWvWSn2s\nZlySGNNwe9sYxgaavHH1Xb0EHhjk7F4AoX40wfC8Lj6oSk8POWVWR0Vr3V2e\nuxYbV+ahKQrL0BLna24l3RNyFxSugWwKWx5cg6RrYgGwYab2wzdpPB3BsymM\nuhZChaSolz8ZUnNs4SoZnPPqkGpzLi/PNxc0z/KC6oO/I+8b3FRIl0gfxDjq\nEzb16KbgjM3SaAYoQRcre/bzWzlnet0mjXUtrn1VqlqgMD5XerCzVKe1aNGT\n+bb6+4x/TrgnxVjXv+S/g+mCuENT3CNjTKSCm9K6pMo2eyjPMk8fWFUkp6zf\nHfuelEUj+NskiCVw6vWOZMU/NCz/5pFDyH+LTEaIBY80zFPCPqOyErejIkVK\n68wdJfSmHEGBvqXXJrE8iJnOUcgcj70y2OMAu2mi783MnbomDAk7mRAdCYBM\nN7Flv7UwwlgNWz8aLN7/WwPLx1hdOA9Oe3Cm9RzvmYPxP5N+wFaEVaAn/BYl\nThAmO67K7BS1BVmpuuGsmQR60del+U9MxNG7WJLBLgrZ5GLYoMMk4reAIVH8\nZO+5ePnJkLWnBZ4teU5sfpsQJ2pV/vXLTDG2/jxVQqrfbmwgWV1q/lcbwNaW\nRyqw741K7l583ptsJ1UyUrQrICyeFTiIQkeJ20i+Z7odMElpR0R/NgZ9FB6d\n8hj7\r\n=Xgw2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEoyTODx0shczDdR2O++TzZxfpGBLvZTbHYFn9AEJRfXAiBRIi6IIG4hWNbERPtbuLzPVjVfUOQjwfDI+9iZYzQ1UA=="}],"size":14883,"noattachment":false,"key":"/smartwrap/-/smartwrap-1.1.2.tgz"},"maintainers":[{"name":"tecfu","email":"help@tecfu.com"}],"_npmUser":{"name":"tecfu","email":"help@tecfu.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/smartwrap_1.1.2_1572803865637_0.42653993066933626"},"_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":1572803865754,"_cnpm_publish_time":1572803865754,"dist-tags":{"latest":"4.0.0"}}