{"name":"smartwrap","version":"2.0.2","description":"Textwrap for javascript/nodejs. Correctly handles wide characters (宽字符) and emojis (😃). Wraps strings with option to break on words.","main":"src/main.js","engines":{"node":">=6"},"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":"MIT","dependencies":{"array.prototype.flat":"^1.2.3","breakword":"^1.0.5","grapheme-splitter":"^1.0.4","strip-ansi":"^6.0.0","wcwidth":"^1.0.1","yargs":"^15.1.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","husky":"^4.2.3","mocha":"^5.2.0"},"gitHead":"008b5365307338776e036b3ca134b762bd00ccf7","bugs":{"url":"https://github.com/tecfu/smartwrap/issues"},"homepage":"https://github.com/tecfu/smartwrap#readme","_id":"smartwrap@2.0.2","_nodeVersion":"14.15.3","_npmVersion":"6.14.9","dist":{"integrity":"sha512-vCsKNQxb7PnCNd2wY1WClWifAc2lwqsG8OaswpJkVJsvMGcnEntdTCDajZCkk93Ay1U3t/9puJmb525Rg5MZBA==","shasum":"7e25d3dd58b51c6ca4aba3a9e391650ea62698a4","tarball":"http://registry-npm.ywwl.com/smartwrap/download/smartwrap-2.0.2.tgz","fileCount":20,"unpackedSize":35716,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgoAvJCRA9TVsSAnZWagAArxwP/iunKTanF6xiIHlN+p0N\n4BQY1Oht2/GFBCcgCXBRxjHKiSFfU16D6NlA/ve+GrrWKPorCqmj6D8djPzW\n1zORcXwkPmrWKDrcbrUWUrM0VnT02j9sWPcTruR/elc6CcThgl1KTTXyth4q\nULNY/7w2yHumtCBX4xSSLKDNNs7Dx0FMrAoRSuhEZX8NLs0Yt/GZopPtCyAQ\nHkmaab97rnz8nv8GWOJP9c9A5yj9hQOUPASd2axgR4mM92DtBm2dJ6I3/mPT\n6sApRusCnpyo2bY+2Sbf+5ejjYLFHZ4Aklbimm4fcoemsNyRXdj4EK4bEOcd\ny3S0adglhnkwPqvzd7XZRaph6xU9euuOWI/qxFcdgh94/HHIkFfm1ZDsUY4+\nYzYVaOnaCdxfedacH3OzA1znuR1bx8/QO+8GoCGjgye/rkleK36lF7YF/1E3\n4+abBidQBfIzZQLiqtZZxeNw9GEG73t3XwdJqkZ3i4x9BC84LKsAgs65tCQH\nXx9HjrDiLqJZuctSt7xqlK798NlYAUcs+lx/lc8bgvVQKGEZuuI7F5ULxiFu\nTFunuZ9xPRc3heXcqxdt3EkKT2t5ynvXqhdipqOVBPHgCvwtPL6BYiEZczFP\nk+ja/6jA55VESlyVcizRJ8P2rhLZFtVEERTeN50g2h+8MtSy/vbGxaTqf/Vi\nN+Xw\r\n=NcYW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE5JUkYl17QxFx3LudurkiLGBC3PmjAzlxIzA7FdmrQ1AiBNt7B8Wmx5AwkOCJd+8WEyhpfg53E3sDwUGEuEqukTyA=="}],"size":11420,"noattachment":false,"key":"/smartwrap/-/smartwrap-2.0.2.tgz"},"_npmUser":{"name":"tecfu","email":"help@tecfu.com"},"directories":{},"maintainers":[{"name":"tecfu","email":"help@tecfu.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/smartwrap_2.0.2_1621101512664_0.0015241911938601582"},"_hasShrinkwrap":false,"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":1621101512796,"_cnpm_publish_time":1621101512796,"dist-tags":{"latest":"4.0.0"}}