{"name":"fast-string-width","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/fast-string-width.git"},"description":"A fast function for calculating the visual width of a string once printed to the terminal.","license":"MIT","version":"1.1.0","type":"module","main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","test":"tsex test","test:watch":"tsex test --watch","prepublishOnly":"tsex prepare"},"keywords":["fast","string","width","cli","terminal"],"dependencies":{"fast-string-truncated-width":"^1.2.0"},"devDependencies":{"fava":"^0.3.4","tsex":"^4.0.2","typescript":"^5.7.3"},"_id":"fast-string-width@1.1.0","gitHead":"cdfba337399f0e07141c5c8d7880dc6cecc7a96d","bugs":{"url":"https://github.com/fabiospampinato/fast-string-width/issues"},"homepage":"https://github.com/fabiospampinato/fast-string-width#readme","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-O3fwIVIH5gKB38QNbdg+3760ZmGz0SZMgvwJbA1b2TGXceKE6A2cOlfogh1iw8lr049zPyd7YADHy+B7U4W9bQ==","shasum":"8122fe1c4699474cb30c84e4419359e2d90c156a","tarball":"http://registry-npm.ywwl.com/fast-string-width/download/fast-string-width-1.1.0.tgz","fileCount":5,"unpackedSize":3573,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDPEkCWqnV+pr0/WddOphbL4E1PaKvnE3OOf54oBLPAYAiAmur6btcfcVzyg5GiFty3bNA/GWygOhmrk3reUmcHMwg=="}],"size":1835,"noattachment":false,"key":"/fast-string-width/-/fast-string-width-1.1.0.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/fast-string-width_1.1.0_1736637287351_0.3386935062501686"},"_hasShrinkwrap":false,"readme":"# Fast String Width\n\nA fast function for calculating the visual width of a string once printed to the terminal.\n\nSee [`fast-string-truncated-width`](https://github.com/fabiospampinato/fast-string-truncated-width) for a lower-level version of this.\n\n## Install\n\n```sh\nnpm install fast-string-width\n```\n\n## Usage\n\n```ts\nimport fastStringWidth from 'fast-string-width';\n\n// The width of various classes of characters is configurable\n\nconst options = {\n  ansiWidth: 0,\n  controlWidth: 0,\n  tabWidth: 8,\n  ambiguousWidth: 1,\n  emojiWidth: 2,\n  fullWidthWidth: 2,\n  regularWidth: 1,\n  wideWidth: 2\n};\n\n// Calculating the visual width of some strings\n\nfastStringWidth ( 'hello', options ); // => 5\nfastStringWidth ( '\\x1b[31mhello', options ); // => 5\nfastStringWidth ( '👨‍👩‍👧‍👦', options ); // => 2\nfastStringWidth ( 'hello👨‍👩‍👧‍👦', options ); // => 7\n\n// Calculating the visual width while tweaking the width of emojis\n\nfastStringWidth ( '👶👶🏽', { ...options, emojiWidth: 1.5 } ); // => 3\n```\n\n## License\n\nMIT © Fabio Spampinato\n","publish_time":1736637287522,"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_cnpm_publish_time":1736637287522,"dist-tags":{"latest":"3.0.2"}}