{"_id":"wcwidth.js","_rev":"732917","name":"wcwidth.js","description":"a javascript porting of C's wcwidth()","dist-tags":{"latest":"1.0.2"},"maintainers":[{"name":"mycoboco","email":"woong.jun@gmail.com"}],"time":{"modified":"2021-09-06T04:15:53.000Z","created":"2012-10-12T06:25:22.416Z","1.0.2":"2021-09-06T04:13:22.458Z","1.0.1":"2021-05-05T14:04:24.073Z","1.0.0":"2014-11-16T05:54:09.577Z","0.0.4":"2014-04-26T10:29:40.155Z","0.0.3":"2013-12-13T01:03:43.921Z","0.0.2":"2013-12-12T15:20:12.472Z","0.0.1":"2012-10-12T06:25:22.416Z"},"users":{},"author":{"name":"Woong Jun","email":"woong.jun@gmail.com","url":"http://code.woong.org/"},"repository":{"type":"git","url":"git+https://github.com/mycoboco/wcwidth.js.git"},"versions":{"1.0.2":{"name":"wcwidth.js","version":"1.0.2","description":"a javascript porting of C's wcwidth()","author":{"name":"Woong Jun","email":"woong.jun@gmail.com","url":"http://code.woong.org/"},"contributors":[{"name":"Tim Oxley","email":"secoif@gmail.com","url":"http://campjs.com/"}],"homepage":"http://code.woong.org/wcwidth.js","repository":{"type":"git","url":"git+https://github.com/mycoboco/wcwidth.js.git"},"bugs":{"url":"https://github.com/mycoboco/wcwidth.js/issues","email":"woong.jun@gmail.com"},"license":"MIT","main":"index.js","scripts":{"test":"tape test/*.js"},"dependencies":{},"devDependencies":{"tape":"^4.2.0"},"engines":{"node":">=4.9.1"},"keywords":["wide character","wc","wide character string","wcs","terminal","width","wcwidth","wcswidth"],"gitHead":"6564fe2db078b414ae20e134089cc42cc70db219","_id":"wcwidth.js@1.0.2","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","_npmUser":{"name":"mycoboco","email":"woong.jun@gmail.com"},"maintainers":[{"name":"mycoboco","email":"woong.jun@gmail.com"}],"dist":{"shasum":"4f0732160c66adfaa556c6764d3df2924c2f8d05","size":5041,"noattachment":false,"key":"/wcwidth.js/-/wcwidth.js-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/wcwidth.js/download/wcwidth.js-1.0.2.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wcwidth.js_1.0.2_1630901602297_0.0020677919068730066"},"_hasShrinkwrap":false,"publish_time":1630901602458,"_cnpm_publish_time":1630901602458},"1.0.1":{"name":"wcwidth.js","version":"1.0.1","description":"a javascript porting of C's wcwidth()","author":{"name":"Woong Jun","email":"woong.jun@gmail.com","url":"http://code.woong.org/"},"contributors":[{"name":"Tim Oxley","email":"secoif@gmail.com","url":"http://campjs.com/"}],"homepage":"http://code.woong.org/wcwidth.js","repository":{"type":"git","url":"git+https://github.com/mycoboco/wcwidth.js.git"},"bugs":{"url":"https://github.com/mycoboco/wcwidth.js/issues","email":"woong.jun@gmail.com"},"license":"MIT","main":"index.js","scripts":{"test":"tape test/*.js"},"dependencies":{},"devDependencies":{"tape":"^4.2.0"},"engines":{"node":">=4.9.1"},"keywords":["wide character","wc","wide character string","wcs","terminal","width","wcwidth","wcswidth"],"gitHead":"6577b93874e03e35116d4dd3d092286935ff5f92","_id":"wcwidth.js@1.0.1","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","_npmUser":{"name":"mycoboco","email":"woong.jun@gmail.com"},"maintainers":[{"name":"mycoboco","email":"woong.jun@gmail.com"}],"dist":{"shasum":"44ad20db7d28dbb0a538604637e905de030f2996","size":5042,"noattachment":false,"key":"/wcwidth.js/-/wcwidth.js-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/wcwidth.js/download/wcwidth.js-1.0.1.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wcwidth.js_1.0.1_1620223463940_0.2750371304847521"},"_hasShrinkwrap":false,"publish_time":1620223464073,"_cnpm_publish_time":1620223464073},"1.0.0":{"name":"wcwidth.js","version":"1.0.0","description":"a javascript porting of C's wcwidth()","author":{"name":"Woong Jun","email":"woong.jun@gmail.com","url":"http://code.woong.org/"},"contributors":[{"name":"Tim Oxley","email":"secoif@gmail.com","url":"http://campjs.com/"}],"homepage":"http://code.woong.org/wcwidth.js","repository":{"type":"git","url":"https://github.com/mycoboco/wcwidth.js.git"},"bugs":{"url":"https://github.com/mycoboco/wcwidth.js/issues","email":"woong.jun@gmail.com"},"main":"index.js","dependencies":{"defaults":"^1.0.0"},"devDependencies":{"tape":"^2.13.4"},"engines":{"node":">=0.8.0"},"licenses":"MIT","keywords":["wide character","wc","wide character string","wcs","terminal","width","wcwidth","wcswidth"],"directories":{"doc":"doc","test":"test"},"scripts":{"test":"tape test/*.js"},"gitHead":"26d6bb6e1e5f50152d683b6f806351dea61868e6","_id":"wcwidth.js@1.0.0","_shasum":"62c19310a3e9c1025cd57f53c35b47acf643fdc3","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"mycoboco","email":"woong.jun@gmail.com"},"maintainers":[{"name":"mycoboco","email":"woong.jun@gmail.com"}],"dist":{"shasum":"62c19310a3e9c1025cd57f53c35b47acf643fdc3","size":7543,"noattachment":false,"key":"/wcwidth.js/-/wcwidth.js-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/wcwidth.js/download/wcwidth.js-1.0.0.tgz"},"publish_time":1416117249577,"_cnpm_publish_time":1416117249577,"_hasShrinkwrap":false},"0.0.4":{"name":"wcwidth.js","version":"0.0.4","description":"A JavaScript porting of C's wcwidth() and wcswidth()","author":{"name":"Woong Jun","email":"woong.jun@gmail.com","url":"http://code.woong.org/"},"contributors":[],"homepage":"http://code.woong.org/wcwidth.js","repository":{"type":"git","url":"https://github.com/mycoboco/wcwidth.js.git"},"bugs":{"url":"https://github.com/mycoboco/wcwidth.js/issues","email":"woong.jun@gmail.com"},"main":"wcwidth.js","dependencies":{"underscore":">= 1.3.0"},"devDependencies":{},"engines":{"node":">= 0.8.0"},"licenses":"MIT","keywords":["wide character","wc","wide character string","wcs","terminal","width","wcwidth","wcswidth"],"_id":"wcwidth.js@0.0.4","dist":{"shasum":"44298a7c899c17501990fdaddd76ef6bd081be75","size":6825,"noattachment":false,"key":"/wcwidth.js/-/wcwidth.js-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/wcwidth.js/download/wcwidth.js-0.0.4.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"mycoboco","email":"woong.jun@gmail.com"},"maintainers":[{"name":"mycoboco","email":"woong.jun@gmail.com"}],"directories":{},"publish_time":1398508180155,"_cnpm_publish_time":1398508180155,"_hasShrinkwrap":false},"0.0.3":{"name":"wcwidth.js","version":"0.0.3","description":"A JavaScript porting of C's wcwidth() and wcswidth()","author":{"name":"Woong Jun","email":"woong.jun@gmail.com","url":"http://code.woong.org/"},"contributors":[],"homepage":"http://code.woong.org/wcwidth.js","repository":{"type":"git","url":"https://github.com/mycoboco/wcwidth.js.git"},"bugs":{"url":"https://github.com/mycoboco/wcwidth.js/issues","email":"woong.jun@gmail.com"},"main":"wcwidth.js","dependencies":{"underscore":">= 1.3.0"},"devDependencies":{},"engines":{"node":">= 0.8.0"},"licenses":"MIT","keywords":["wide character","wc","wide character string","wcs","terminal","width","wcwidth","wcswidth"],"readmeFilename":"README.md","_id":"wcwidth.js@0.0.3","dist":{"shasum":"f6359949318a2e84ce3f1ca64ccc947ef2dffd13","size":6533,"noattachment":false,"key":"/wcwidth.js/-/wcwidth.js-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/wcwidth.js/download/wcwidth.js-0.0.3.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"mycoboco","email":"woong.jun@gmail.com"},"maintainers":[{"name":"mycoboco","email":"woong.jun@gmail.com"}],"directories":{},"publish_time":1386896623921,"_cnpm_publish_time":1386896623921,"_hasShrinkwrap":false},"0.0.2":{"name":"wcwidth.js","version":"0.0.2","description":"A JavaScript porting of C's wcwidth() and wcswidth()","author":{"name":"Woong Jun","email":"woong.jun@gmail.com","url":"http://code.woong.org/"},"contributors":[],"homepage":"http://code.woong.org/wcwidth.js","repository":{"type":"git","url":"https://github.com/mycoboco/wcwidth.js.git"},"bugs":{"url":"https://github.com/mycoboco/wcwidth.js/issues","email":"woong.jun@gmail.com"},"main":"wcwidth.js","dependencies":{"underscore":">= 1.3.0"},"devDependencies":{},"engines":{"node":">= 0.8.0"},"licenses":"MIT","keywords":["wide character","wc","wide character string","wcs","terminal","width","wcwidth","wcswidth"],"readmeFilename":"README.md","_id":"wcwidth.js@0.0.2","dist":{"shasum":"2a5634eb2f349b05e69dfd03f659a0f45234b359","size":6529,"noattachment":false,"key":"/wcwidth.js/-/wcwidth.js-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/wcwidth.js/download/wcwidth.js-0.0.2.tgz"},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"mycoboco","email":"woong.jun@gmail.com"},"maintainers":[{"name":"mycoboco","email":"woong.jun@gmail.com"}],"directories":{},"publish_time":1386861612472,"_cnpm_publish_time":1386861612472,"_hasShrinkwrap":false},"0.0.1":{"name":"wcwidth.js","version":"0.0.1","description":"A JavaScript porting of C's wcwidth() and wcswidth()","author":{"name":"Woong Jun","email":"woong.jun@gmail.com","url":"http://code.woong.org/"},"contributors":[],"homepage":"http://code.woong.org/wcwidth.js","repository":{"type":"hg","url":"http://code.woong.org/hg/wcwidth.js"},"bugs":{"url":"http://code.woong.org/wcwidth.js/trac","email":"woong.jun@gmail.com"},"main":"wcwidth.js","dependencies":{"underscore":">= 1.3.0"},"devDependencies":{},"engines":{"node":">= 0.8.0"},"licenses":"MIT","keywords":["wide character","wc","wide character string","wcs","terminal","width","wcwidth","wcswidth"],"_id":"wcwidth.js@0.0.1","dist":{"shasum":"697ef3657c566129656b91be8decb3932fd13544","size":6218,"noattachment":false,"key":"/wcwidth.js/-/wcwidth.js-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/wcwidth.js/download/wcwidth.js-0.0.1.tgz"},"maintainers":[{"name":"mycoboco","email":"woong.jun@gmail.com"}],"directories":{},"publish_time":1350023122416,"_cnpm_publish_time":1350023122416,"_hasShrinkwrap":false}},"readme":"wcwidth.js: a javascript porting of C's wcwidth()\n=================================================\n\n`wcwidth.js` is a simple javascript porting of `wcwidth()` implemented in C\n[by Markus Kuhn](http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c).\n\n[`wcwidth()`](http://www.opengroup.org/onlinepubs/007904975/functions/wcwidth.html)\nand its string version,\n[`wcswidth()`](http://www.opengroup.org/onlinepubs/007904975/functions/wcswidth.html)\nare defined by IEEE Std 1002.1-2001, a.k.a. POSIX.1-2001, and return the number\nof columns used to represent a wide character and string on fixed-width output\ndevices like terminals. Markus's implementation assumes wide characters to be\nencoded in [ISO 10646](http://en.wikipedia.org/wiki/Universal_Character_Set),\nwhich is _almost_ true for JavaScript; _almost_ because JavaScript uses\n[UCS-2](http://en.wikipedia.org/wiki/UTF-16) and has problems with surrogate\npairs. `wcwidth.js` converts surrogate pairs to Unicode code points to handle\nthem correctly.\n\nFollowing the original implementation, this library defines the column width of\nan ISO 10646 character as follows:\n- the null character (`U+0000`) has a column width of `opts.null` (whose\n  default value is 0);\n- other\n  [C0/C1 control characters](http://en.wikipedia.org/wiki/C0_and_C1_control_codes)\n  and `DEL` will lead to a column width of `opts.control` (whose default value\n  is 0);\n- non-spacing and enclosing combining characters\n  ([general category code](http://www.unicode.org/reports/tr44/#GC_Values_Table)\n  `Mn` or `Me`) in the Unicode database) have a column width of 0;\n- `SOFT HYPHEN` (`U+00AD`) has a column width of 1;\n- other format characters (general category code `Cf` in the Unicode database)\n  and `ZERO WIDTH SPACE` (`U+200B`) have a column width of 0;\n- Hangul Jamo medial vowels and final consonants (`U+1160`-`U+11FF`) have a\n  column width of 0;\n- spacing characters in the East Asian Wide (`W`) or East Asian Full-width\n  (`F`) category as defined in\n  [Unicode Technical Report #11](http://www.unicode.org/reports/tr11/) have a\n  column width of 2; and\n- all remaining characters (including all printable\n  [ISO 8859-1](http://en.wikipedia.org/wiki/ISO/IEC_8859-1) and\n  [WGL4 characters](http://en.wikipedia.org/wiki/Windows_Glyph_List_4), Unicode\n  control characters, etc.) have a column width of 1.\n\nA surrogate high or low value which constitutes no pair is considered to have a\ncolumn width of 1 according to the behavior of widespread terminals.\n\nSee the\n[documentation](https://github.com/mycoboco/wcwidth.js/blob/master/doc/index.md)\nfrom the C implementation for details.\n\n`wcwidth.js` is simple to use:\n\n    var wcwidth = require('wcwidth.js')\n\n    wcwidth('한글')    // 4\n    wcwidth('\\0')      // 0; NUL\n    wcwidth('\\t')      // 0; control characters\n\nIf you plan to replace `NUL` or control characters with, say, `???` before\nprinting, use `wcwidth.config()` that returns a closure to run `wcwidth` with\nyour configuration:\n\n    var mywidth = wcwidth.config({\n        nul:     3,\n        control: 3\n    })\n\n    mywidth('\\0\\f')      // 6\n    mywidth('한\\t글')    // 7\n\nSetting these options to -1 gives a function that returns -1 for a string\ncontaining an instance of `NUL` or control characters:\n\n    mywidth = wcwidth.config({\n        nul:     0,\n        control: -1\n    })\n\n    mywidth('java\\0script')    // 10\n    mywidth('java\\tscript')    // -1\n\nThis is useful when detecting if a string has non-printable characters.\n\nDue to the risk of monkey-patching, no `String` getter is provided anymore.\nEven if discouraged, you can still monkey-patch by yourself as follows:\n\n    String.prototype.__defineGetter__('wcwidth', function () {\n        return wcwidth(this);\n    })\n    '한글'.wcwidth    // 4\n\nJavaScript has no character type, thus meaningless to have two versions of\n`wcwidth` while POSIX does for C. `wcwidth` also accepts a code value obtained\nby `charCodeAt()`:\n\n    wcwidth('한')                  // prints 2\n    wcwidth('글'.charCodeAt(0))    // prints 2\n\n`INSTALL.md` explains how to build and install the library. For the copyright\nissues, see the accompanying `LICENSE.md` file.\n\nIf you have a question or suggestion, do not hesitate to contact me via email\n(woong.jun at gmail.com) or web (http://code.woong.org/).\n","_attachments":{},"homepage":"http://code.woong.org/wcwidth.js","bugs":{"url":"https://github.com/mycoboco/wcwidth.js/issues","email":"woong.jun@gmail.com"},"license":"MIT"}