{"name":"smartwrap","version":"1.0.8","description":"Textwrap for javascript/nodejs. Correctly handles wide characters (宽字符) and emojis (😃). Automatically breaks long words.","main":"dist/main.js","bin":{"smartwrap":"dist/terminal-adapter.js"},"scripts":{"test":"grunt t"},"repository":{"type":"git","url":"https://www.github.com/tecfu/smartwrap.git"},"keywords":["wordwrap"],"author":{"name":"tecfu"},"license":"GPL-2.0","dependencies":{"breakword":"^1.0.3","merge":"^1.2.0","wcwidth":"^1.0.1","yargs":"^8.0.1"},"devDependencies":{"chai":"^4.0.2","grunt":"^1.0.1","grunt-cli":"^1.2.0","grunt-mocha-test":"^0.13.2","mocha":"^3.4.1"},"gitHead":"1f15b04132e98e58c26039a7e7712bcfae9377f3","_id":"smartwrap@1.0.8","_shasum":"da05d48c6aac8aafe9c265c71071b18e1b69c5fd","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"tecfu","email":"help@tecfu.com"},"dist":{"shasum":"da05d48c6aac8aafe9c265c71071b18e1b69c5fd","tarball":"http://registry-npm.ywwl.com/smartwrap/download/smartwrap-1.0.8.tgz","integrity":"sha512-4qucfUDs9e6+jH7OW1NpXMNtnkiOtpvHyxXbm3avuARiyAGe5WEOC1m/GdDHKyvcWiP7iSjXAmvcBmjYNygOkg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLCpr/p3E+tRIHAhZm/9c42gFWzhmY1NMAWUFTCe+n2QIhAISEFfB4s2dlQ1LFJo33rdHGPOZq+QsSokpuLnaTIhSB"}],"size":16232,"noattachment":false,"key":"/smartwrap/-/smartwrap-1.0.8.tgz"},"maintainers":[{"name":"tecfu","email":"help@tecfu.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/smartwrap-1.0.8.tgz_1497048789630_0.6567838962655514"},"directories":{},"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":1497048789765,"_cnpm_publish_time":1497048789765,"dist-tags":{"latest":"4.0.0"}}