{"name":"smartwrap","version":"1.2.0","description":"Textwrap for javascript/nodejs. Correctly handles wide characters (宽字符) and emojis (😃). Wraps strings with option to break on words.","main":"src/main.js","bin":{"smartwrap":"src/terminal-adapter.js"},"scripts":{"test":"grunt t","test-display":"grunt test-display","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":"f6ead233ecbed3b9d6e7cb58fad1af3cf2a284f4","bugs":{"url":"https://github.com/tecfu/smartwrap/issues"},"homepage":"https://github.com/tecfu/smartwrap#readme","_id":"smartwrap@1.2.0","_nodeVersion":"12.9.1","_npmVersion":"6.10.2","dist":{"integrity":"sha512-gRP/ZRugI16fx79zCwVj0yQcMDOjh5iN7WGoDLrMu7hz2ZYsplv/k7r6honHnRD/X7TaySU48HAFLtXGZ/j2kw==","shasum":"9241ac6580326d76cde9e70ddb312cfc48a4fe00","tarball":"http://registry-npm.ywwl.com/smartwrap/download/smartwrap-1.2.0.tgz","fileCount":16,"unpackedSize":43876,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdygHUCRA9TVsSAnZWagAAdi0P/0C4iVhIZ4+BWR2YOCM0\nwmEw5gZ51LAxVY9ptn4IyOi8ojF8bDcmsZ5vySAAw6xEAHDC90gGpCaao/be\nzy4IXysQ7qrVbcO6+3SFrwLFFgQWKC3UPbyL/8Z7N8xkXgCOvF/8BD/s4XIO\n4+A/4BZU47pBzqPNVU9auXH5Ky2bJ8w4WQxulOjUKPHTmVWp3i1kG/my1KXT\nhaRe71bLQIssvPfz1GRqV7PiWYLJvqNtfZPdHG/fRbT/mmGkWKmsAZut9y8i\nViqcekWhXJV6995AqAzzrbaX+BTt+aT1gd4BImcounNRnfld4gFkQ06aHy3H\nob6r1KVvY/WUI15EpndOEqm7vEEKQbh1Y8+nneqoxr65c4Ty9kmk8iVs4ATz\nBU5ucN+JIVxntnhhqJ1MSulwdApq8pKIGwrpq9XZfVkoPy/U6j5SKPBYPik7\n+1lKCP11ygWEy9dafhrsyYiCRyI0r+GBF91CXPHJ2xtD1wemhlbgSNNdXoPU\nU0c50kJKgGj/ZLFwQiZLMnGofDjGx6icapgTxcfjD6U46xbsEtFdFL6F8EIV\nZKA8IyOtBN1uEFsZigdNvXTWS6RGF5Se+bwfgyNDAg2IBW4pvVX97oo9h8it\n5kqfABrhN4jDnMtZj3Gi+Hv+NJ1rJQmVMB72AOFkrvToIbQLkNs9R6CLpUNZ\nKLTU\r\n=tGGk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwGw5FqR+wtc7ElRdOM80ET7YXsyiZBq8oaj7NDgOYFQIhAJGLKf2MNNEv9gf9bm0SgZ1h8wK/u0BpqIgW/TcaqvYr"}],"size":15304,"noattachment":false,"key":"/smartwrap/-/smartwrap-1.2.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.2.0_1573519827750_0.33783106163552556"},"_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":1573519827870,"_cnpm_publish_time":1573519827870,"dist-tags":{"latest":"4.0.0"}}