{"name":"smartwrap","version":"1.1.0","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":"^13.3.0"},"devDependencies":{"chai":"^4.2.0","grunt":"^1.0.4","grunt-cli":"^1.3.2","grunt-mocha-test":"^0.13.3","mocha":"^5.2.0"},"gitHead":"12fc5806556a7ffaffd2f1654dd35967db50c8a9","bugs":{"url":"https://github.com/tecfu/smartwrap/issues"},"homepage":"https://github.com/tecfu/smartwrap#readme","_id":"smartwrap@1.1.0","_nodeVersion":"12.6.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-DISoGVrbQQVlZNCveG0zpnG2R5jX0kaHKZZwu8eCiJaqHdtVSDOGpX1HNpJpAHKy2yvfrHt/2i1YgtHTI/jIzw==","shasum":"99d9dfe9be1b3beff88114a991567f523d3eab26","tarball":"http://registry-npm.ywwl.com/smartwrap/download/smartwrap-1.1.0.tgz","fileCount":14,"unpackedSize":41277,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdZrYgCRA9TVsSAnZWagAAAO0QAIsZ1/F4iuDX4bAqInLE\naumVKHprqcG9r+4/jcNyGlP4YdPZTIKYp3tomByDC5ZK4/Q90jJeKTn6jPHx\nut4fS5ZqpIkG3ACbavwoG0cxemoUS/TipcBwcVRKmYQqKa2wo9T+ApDiRiQz\npSbZSYzjDjzAwPpZ9BOTUzLjeni2isbLAlpoeEWW8Ys1PBVU85lIY7ohp+Cv\n0bRoQfu/76/UKuFnf5482hEWU9xKfpNOrz2ovxE896vbGP0V2/Dixuy7cxVn\n/nPqjUet43Zc7/w8XNmW2iS7xJ4Bs+UZwsOtLOuGgpHZAhmeyMHoXvCbJq5U\nB5ANSIViFUVLHMses9bJ0fx17/IQegziNgg2L2zyspK8YzNo2G0CxGvAmQTg\n+0U++gZv5sP+rL51QE1T1f4BEUXffXKUPEWhsT9oNeb1R+Ee8hjh1htmprc/\nXA8WmDdLXY5Jyy0fWaC5IbOc8MjMqhfvU9MIbH394Ak1inqYlqYQGu4EbfHn\nygy8MJ7L3o1Kt6uq+tYfntpK5pEfbnnQykQDPHLE+8ksseRrgnLpgUmkHngo\nL2DqzxlnDtZPP6Bi3m/yqe8QGCSMqgg9Zo3WEcDhjdffGBCtbF8KOwWIIVsp\noz5uXRXWtEbHDyM+Nsav146OFbDWwEZo6mR8scbLYE9P7sYrDxeKLJaUIjJz\nPbfi\r\n=+I5t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEUyEXr+KH8JXeYVTbHoViKkwd1zh0nDMmzQhYcHUS2PAiEA29JneEVXtKMGgCkfrqm3T+ovbRKXDa5/hHVjdTzjU44="}],"size":14583,"noattachment":false,"key":"/smartwrap/-/smartwrap-1.1.0.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.0_1567012383987_0.6261629706622949"},"_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":1567012384122,"_cnpm_publish_time":1567012384122,"dist-tags":{"latest":"4.0.0"}}