{"name":"smartwrap","version":"1.0.2","description":"Wordwrap that doesn't split words unless the word length is greater that the line width.","main":"index.js","scripts":{"test":"grunt t"},"repository":{"type":"git","url":"https://www.github.com/tecfu/smartwrap.git"},"keywords":["wordwrap"],"author":{"name":"tecfu"},"license":"ISC","dependencies":{"breakword":"^1.0.2","merge":"^1.2.0"},"devDependencies":{"grunt-mocha-test":"^0.13.2","mocha":"^3.4.1"},"gitHead":"e9cb975ea2af54a62d788d028d7babb47415e0ed","_id":"smartwrap@1.0.2","_shasum":"c6d887e831606110bdba29a36f5fb3a55903cc38","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"tecfu","email":"help@tecfu.com"},"dist":{"shasum":"c6d887e831606110bdba29a36f5fb3a55903cc38","tarball":"http://registry-npm.ywwl.com/smartwrap/download/smartwrap-1.0.2.tgz","integrity":"sha512-0XbD6dCRegU8pfsncMLMS8pqJOha7zO6gzeuBxB+3NKD8UnP6+nVkSLRB12kXYXNSJhXnRUVbT+hnSyXlSKq+g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDr1T8Cf0PbijisOfxaQubK/MrrOKKlE0+Cy6Q2EO7bXAIhANHP9pE/1nWKHYobcwYpFHFIIZpy+IoRSnFQohHdpoms"}],"size":12840,"noattachment":false,"key":"/smartwrap/-/smartwrap-1.0.2.tgz"},"maintainers":[{"name":"tecfu","email":"help@tecfu.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/smartwrap-1.0.2.tgz_1495237363916_0.3507771643344313"},"deprecated":"Backported compatibility to node > 6","directories":{},"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":1495237364033,"_cnpm_publish_time":1495237364033,"dist-tags":{"latest":"4.0.0"}}