{"_id":"cli-truncate","_rev":"4308681","name":"cli-truncate","description":"Truncate a string to a specific width in the terminal","dist-tags":{"latest":"6.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2026-04-07T21:44:12.000Z","created":"2016-03-11T08:53:03.286Z","6.0.0":"2026-04-04T13:38:05.476Z","5.2.0":"2026-03-01T07:17:21.260Z","5.1.1":"2025-10-23T05:01:21.176Z","5.1.0":"2025-09-15T20:06:34.000Z","5.0.0":"2025-08-31T07:57:38.745Z","4.0.0":"2023-10-28T17:05:43.610Z","3.1.0":"2021-10-09T13:32:39.035Z","3.0.0":"2021-08-10T22:03:37.806Z","2.1.0":"2019-12-06T07:47:55.662Z","2.0.0":"2019-06-13T07:19:48.480Z","1.1.0":"2017-07-23T10:56:44.162Z","1.0.0":"2017-01-13T10:43:54.984Z","0.2.1":"2016-04-05T08:20:22.975Z","0.2.0":"2016-03-13T07:48:53.614Z","0.1.0":"2016-03-11T08:53:03.286Z"},"users":{"insomniaqc":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/cli-truncate.git"},"versions":{"6.0.0":{"name":"cli-truncate","version":"6.0.0","description":"Truncate a string to a specific width in the terminal","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/cli-truncate.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=22"},"scripts":{"test":"xo && ava && tsd"},"keywords":["truncate","ellipsis","text","limit","slice","cli","terminal","term","shell","width","ansi","string"],"dependencies":{"slice-ansi":"^9.0.0","string-width":"^8.2.0"},"devDependencies":{"ava":"^7.0.0","tsd":"^0.33.0","xo":"^2.0.2"},"gitHead":"7a4610b1ca9fecf395a03ddc602d7487f0a093ba","types":"./index.d.ts","_id":"cli-truncate@6.0.0","bugs":{"url":"https://github.com/sindresorhus/cli-truncate/issues"},"homepage":"https://github.com/sindresorhus/cli-truncate#readme","_nodeVersion":"25.8.0","_npmVersion":"11.12.0","dist":{"shasum":"9e7c9b64649e4bd35e6a77919797c30ba7dc0095","size":3864,"noattachment":false,"key":"/cli-truncate/-/cli-truncate-6.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cli-truncate/download/cli-truncate-6.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cli-truncate_6.0.0_1775309885338_0.19453734200026696"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-04-04T13:38:05.476Z","publish_time":1775309885476,"_source_registry_name":"default","_cnpm_publish_time":1775309885476},"5.2.0":{"name":"cli-truncate","version":"5.2.0","description":"Truncate a string to a specific width in the terminal","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/cli-truncate.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=20"},"scripts":{"test":"xo && ava && tsd"},"keywords":["truncate","ellipsis","text","limit","slice","cli","terminal","term","shell","width","ansi","string"],"dependencies":{"slice-ansi":"^8.0.0","string-width":"^8.2.0"},"devDependencies":{"ava":"^7.0.0","tsd":"^0.33.0","xo":"^1.2.2"},"gitHead":"8cb2b432d2a5d29f9bde2af0ca8e250819d013e7","types":"./index.d.ts","_id":"cli-truncate@5.2.0","bugs":{"url":"https://github.com/sindresorhus/cli-truncate/issues"},"homepage":"https://github.com/sindresorhus/cli-truncate#readme","_nodeVersion":"25.6.0","_npmVersion":"11.11.0","dist":{"shasum":"c8e72aaca8339c773d128c36e0a17c6315b694eb","size":3868,"noattachment":false,"key":"/cli-truncate/-/cli-truncate-5.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cli-truncate/download/cli-truncate-5.2.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cli-truncate_5.2.0_1772349441112_0.7625546832763201"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-03-01T07:17:21.260Z","publish_time":1772349441260,"_source_registry_name":"default","_cnpm_publish_time":1772349441260},"5.1.1":{"name":"cli-truncate","version":"5.1.1","description":"Truncate a string to a specific width in the terminal","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/cli-truncate.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=20"},"scripts":{"test":"xo && ava && tsd"},"keywords":["truncate","ellipsis","text","limit","slice","cli","terminal","term","shell","width","ansi","string"],"dependencies":{"slice-ansi":"^7.1.0","string-width":"^8.0.0"},"devDependencies":{"ava":"^6.4.1","tsd":"^0.33.0","xo":"^1.2.2"},"gitHead":"df88f09a26657a60c864605e7cf4d9770e0e772a","types":"./index.d.ts","_id":"cli-truncate@5.1.1","bugs":{"url":"https://github.com/sindresorhus/cli-truncate/issues"},"homepage":"https://github.com/sindresorhus/cli-truncate#readme","_nodeVersion":"24.9.0","_npmVersion":"11.6.1","dist":{"shasum":"455476face9904d94b7d11e98d9adbca15292ea5","size":3918,"noattachment":false,"key":"/cli-truncate/-/cli-truncate-5.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/cli-truncate/download/cli-truncate-5.1.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cli-truncate_5.1.1_1761195680850_0.10285184753403809"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-10-23T05:01:21.176Z","publish_time":1761195681176,"_source_registry_name":"default","_cnpm_publish_time":1761195681176},"5.1.0":{"name":"cli-truncate","version":"5.1.0","description":"Truncate a string to a specific width in the terminal","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/cli-truncate.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=20"},"scripts":{"test":"xo && ava && tsd"},"keywords":["truncate","ellipsis","text","limit","slice","cli","terminal","term","shell","width","ansi","string"],"dependencies":{"slice-ansi":"^7.1.0","string-width":"^8.0.0"},"devDependencies":{"ava":"^6.4.1","tsd":"^0.33.0","xo":"^1.2.2"},"_id":"cli-truncate@5.1.0","gitHead":"fa0cd8e25aa3f3f39737d775b71c194b2c79b301","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/cli-truncate/issues"},"homepage":"https://github.com/sindresorhus/cli-truncate#readme","_nodeVersion":"20.19.1","_npmVersion":"10.9.2","dist":{"shasum":"bb12607a62f0e4bb91a54aa4653b23347900bb55","size":3917,"noattachment":false,"key":"/cli-truncate/-/cli-truncate-5.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cli-truncate/download/cli-truncate-5.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cli-truncate_5.1.0_1757966793791_0.5593671551347861"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-09-15T20:06:34.000Z","publish_time":1757966794000,"_source_registry_name":"default","_cnpm_publish_time":1757966794000},"5.0.0":{"name":"cli-truncate","version":"5.0.0","description":"Truncate a string to a specific width in the terminal","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/cli-truncate.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=20"},"scripts":{"test":"xo && ava && tsd"},"keywords":["truncate","ellipsis","text","limit","slice","cli","terminal","term","shell","width","ansi","string"],"dependencies":{"slice-ansi":"^7.1.0","string-width":"^8.0.0"},"devDependencies":{"ava":"^6.4.1","tsd":"^0.33.0","xo":"^1.2.2"},"_id":"cli-truncate@5.0.0","gitHead":"8f0d9d93e9281855166975db26908f2a11bac54b","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/cli-truncate/issues"},"homepage":"https://github.com/sindresorhus/cli-truncate#readme","_nodeVersion":"22.12.0","_npmVersion":"10.9.2","dist":{"shasum":"ce06d96ab246c35402ebfd12cf799828b24b53e4","size":3328,"noattachment":false,"key":"/cli-truncate/-/cli-truncate-5.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cli-truncate/download/cli-truncate-5.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cli-truncate_5.0.0_1756627058563_0.5052654821225693"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-08-31T07:57:38.745Z","publish_time":1756627058745,"_source_registry_name":"default","_cnpm_publish_time":1756627058745},"4.0.0":{"name":"cli-truncate","version":"4.0.0","description":"Truncate a string to a specific width in the terminal","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/cli-truncate.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsd"},"keywords":["truncate","ellipsis","text","limit","slice","cli","terminal","term","shell","width","ansi","string"],"dependencies":{"slice-ansi":"^5.0.0","string-width":"^7.0.0"},"devDependencies":{"ava":"^5.3.1","tsd":"^0.29.0","xo":"^0.56.0"},"types":"./index.d.ts","gitHead":"7080bf23f18ebca5557796711e520feac6fdf05a","bugs":{"url":"https://github.com/sindresorhus/cli-truncate/issues"},"homepage":"https://github.com/sindresorhus/cli-truncate#readme","_id":"cli-truncate@4.0.0","_nodeVersion":"18.18.2","_npmVersion":"9.2.0","dist":{"shasum":"6cc28a2924fee9e25ce91e973db56c7066e6172a","size":3278,"noattachment":false,"key":"/cli-truncate/-/cli-truncate-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cli-truncate/download/cli-truncate-4.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cli-truncate_4.0.0_1698512743171_0.6531204434558815"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-10-28T17:05:43.610Z","publish_time":1698512743610,"_source_registry_name":"default","_cnpm_publish_time":1698512743610},"3.1.0":{"name":"cli-truncate","version":"3.1.0","description":"Truncate a string to a specific width in the terminal","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/cli-truncate.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["truncate","ellipsis","text","limit","slice","cli","terminal","term","shell","width","ansi","string"],"dependencies":{"slice-ansi":"^5.0.0","string-width":"^5.0.0"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.17.0","xo":"^0.44.0"},"gitHead":"ad595f2b1a7522e8dd209f05397d993ca6725c1f","bugs":{"url":"https://github.com/sindresorhus/cli-truncate/issues"},"homepage":"https://github.com/sindresorhus/cli-truncate#readme","_id":"cli-truncate@3.1.0","_nodeVersion":"14.17.5","_npmVersion":"7.20.3","dist":{"shasum":"3f23ab12535e3d73e839bb43e73c9de487db1389","size":3532,"noattachment":false,"key":"/cli-truncate/-/cli-truncate-3.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cli-truncate/download/cli-truncate-3.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cli-truncate_3.1.0_1633786358870_0.5083519279172302"},"_hasShrinkwrap":false,"publish_time":1633786359035,"_cnpm_publish_time":1633786359035},"3.0.0":{"name":"cli-truncate","version":"3.0.0","description":"Truncate a string to a specific width in the terminal","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/cli-truncate.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["truncate","ellipsis","text","limit","slice","cli","terminal","term","shell","width","ansi","string"],"dependencies":{"slice-ansi":"^5.0.0","string-width":"^5.0.0"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.17.0","xo":"^0.44.0"},"gitHead":"42f602d1af13387515c8d6b7f02915c7021c0544","bugs":{"url":"https://github.com/sindresorhus/cli-truncate/issues"},"homepage":"https://github.com/sindresorhus/cli-truncate#readme","_id":"cli-truncate@3.0.0","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"shasum":"30d44a90abd9df510c5931b75926658abfd3d750","size":3452,"noattachment":false,"key":"/cli-truncate/-/cli-truncate-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cli-truncate/download/cli-truncate-3.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cli-truncate_3.0.0_1628633017666_0.700204790817966"},"_hasShrinkwrap":false,"publish_time":1628633017806,"_cnpm_publish_time":1628633017806},"2.1.0":{"name":"cli-truncate","version":"2.1.0","description":"Truncate a string to a specific width in the terminal","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/cli-truncate.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["truncate","ellipsis","text","limit","slice","cli","terminal","term","shell","width","ansi","string"],"dependencies":{"slice-ansi":"^3.0.0","string-width":"^4.2.0"},"devDependencies":{"ava":"^2.1.0","tsd":"^0.11.0","xo":"^0.25.3"},"gitHead":"2f422c146701b9e76ac93b2f88753a915be37301","bugs":{"url":"https://github.com/sindresorhus/cli-truncate/issues"},"homepage":"https://github.com/sindresorhus/cli-truncate#readme","_id":"cli-truncate@2.1.0","_nodeVersion":"10.17.0","_npmVersion":"6.13.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"c39e28bf05edcde5be3b98992a22deed5a2b93c7","size":3513,"noattachment":false,"key":"/cli-truncate/-/cli-truncate-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cli-truncate/download/cli-truncate-2.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cli-truncate_2.1.0_1575618475548_0.4744743301264074"},"_hasShrinkwrap":false,"publish_time":1575618475662,"_cnpm_publish_time":1575618475662},"2.0.0":{"name":"cli-truncate","version":"2.0.0","description":"Truncate a string to a specific width in the terminal","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/cli-truncate.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["truncate","ellipsis","text","limit","slice","cli","terminal","term","shell","width","ansi","string"],"dependencies":{"slice-ansi":"^2.1.0","string-width":"^4.1.0"},"devDependencies":{"ava":"^2.1.0","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"4ded8c0075e0bedd4dba69db9017d0ec7c6798a3","bugs":{"url":"https://github.com/sindresorhus/cli-truncate/issues"},"homepage":"https://github.com/sindresorhus/cli-truncate#readme","_id":"cli-truncate@2.0.0","_nodeVersion":"8.16.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"68ff6aaa53b203b52ad89b8b1a80f1f61ad1e1d5","size":3224,"noattachment":false,"key":"/cli-truncate/-/cli-truncate-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cli-truncate/download/cli-truncate-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cli-truncate_2.0.0_1560410388373_0.3194934995762728"},"_hasShrinkwrap":false,"publish_time":1560410388480,"_cnpm_publish_time":1560410388480},"1.1.0":{"name":"cli-truncate","version":"1.1.0","description":"Truncate a string to a specific width in the terminal","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/cli-truncate.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["truncate","ellipsis","text","limit","slice","cli","terminal","term","shell","width","ansi"],"dependencies":{"slice-ansi":"^1.0.0","string-width":"^2.0.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"94f26977e8f1603b306e8759147c8c9159ab3b39","bugs":{"url":"https://github.com/sindresorhus/cli-truncate/issues"},"homepage":"https://github.com/sindresorhus/cli-truncate#readme","_id":"cli-truncate@1.1.0","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"2b2dfd83c53cfd3572b87fc4d430a808afb04086","size":2338,"noattachment":false,"key":"/cli-truncate/-/cli-truncate-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cli-truncate/download/cli-truncate-1.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cli-truncate-1.1.0.tgz_1500807402887_0.6349338984582573"},"directories":{},"publish_time":1500807404162,"_hasShrinkwrap":false,"_cnpm_publish_time":1500807404162},"1.0.0":{"name":"cli-truncate","version":"1.0.0","description":"Truncate a string to a specific width in the terminal","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/cli-truncate.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["truncate","ellipsis","text","limit","slice","cli","terminal","term","shell","width","ansi"],"dependencies":{"slice-ansi":"0.0.4","string-width":"^2.0.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"4da60e7a45a8c333843ffdc941726edd9f0cd050","bugs":{"url":"https://github.com/sindresorhus/cli-truncate/issues"},"homepage":"https://github.com/sindresorhus/cli-truncate#readme","_id":"cli-truncate@1.0.0","_shasum":"21eb91f47b3f6560f004db77a769b4668d9c5518","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.6.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"21eb91f47b3f6560f004db77a769b4668d9c5518","size":2260,"noattachment":false,"key":"/cli-truncate/-/cli-truncate-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cli-truncate/download/cli-truncate-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/cli-truncate-1.0.0.tgz_1484304234747_0.6612277985550463"},"directories":{},"publish_time":1484304234984,"_cnpm_publish_time":1484304234984,"_hasShrinkwrap":false},"0.2.1":{"name":"cli-truncate","version":"0.2.1","description":"Truncate a string to a specific width in the terminal","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/cli-truncate"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["truncate","ellipsis","text","limit","slice","cli","terminal","term","shell","width","ansi"],"dependencies":{"slice-ansi":"0.0.4","string-width":"^1.0.1"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"b76c964800573b5131e4965b3c0f2eaff22a3650","bugs":{"url":"https://github.com/sindresorhus/cli-truncate/issues"},"homepage":"https://github.com/sindresorhus/cli-truncate","_id":"cli-truncate@0.2.1","_shasum":"9f15cfbb0705005369216c626ac7d05ab90dd574","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"9f15cfbb0705005369216c626ac7d05ab90dd574","size":2239,"noattachment":false,"key":"/cli-truncate/-/cli-truncate-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/cli-truncate/download/cli-truncate-0.2.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/cli-truncate-0.2.1.tgz_1459844422490_0.3644009679555893"},"directories":{},"publish_time":1459844422975,"_cnpm_publish_time":1459844422975,"_hasShrinkwrap":false},"0.2.0":{"name":"cli-truncate","version":"0.2.0","description":"Truncate a string to a specific width in the terminal","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/cli-truncate"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["truncate","ellipsis","text","limit","slice","cli","terminal","term","shell","width","ansi"],"dependencies":{"slice-ansi":"0.0.4","string-width":"^1.0.1"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"86ee06ef054f93afe78b42333e00e9ed3cd70835","bugs":{"url":"https://github.com/sindresorhus/cli-truncate/issues"},"homepage":"https://github.com/sindresorhus/cli-truncate","_id":"cli-truncate@0.2.0","_shasum":"def59aa9a148d7b826178c545779871df3cafef3","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"def59aa9a148d7b826178c545779871df3cafef3","size":1977,"noattachment":false,"key":"/cli-truncate/-/cli-truncate-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cli-truncate/download/cli-truncate-0.2.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/cli-truncate-0.2.0.tgz_1457855333123_0.12254591472446918"},"directories":{},"publish_time":1457855333614,"_cnpm_publish_time":1457855333614,"_hasShrinkwrap":false},"0.1.0":{"name":"cli-truncate","version":"0.1.0","description":"Truncate a string to a specific width in the terminal","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/cli-truncate"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["truncate","ellipsis","text","limit","slice","cli","terminal","term","shell","width","ansi"],"dependencies":{"string-width":"^1.0.1","wrap-ansi":"^2.0.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"dbc522d6f3c1fd7b287b39521ed73a7c9e98fd66","bugs":{"url":"https://github.com/sindresorhus/cli-truncate/issues"},"homepage":"https://github.com/sindresorhus/cli-truncate","_id":"cli-truncate@0.1.0","_shasum":"914809251f8fcfc4f22a716061731c6b94513935","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"914809251f8fcfc4f22a716061731c6b94513935","size":1993,"noattachment":false,"key":"/cli-truncate/-/cli-truncate-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cli-truncate/download/cli-truncate-0.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/cli-truncate-0.1.0.tgz_1457686382816_0.01899998914450407"},"directories":{},"publish_time":1457686383286,"_cnpm_publish_time":1457686383286,"_hasShrinkwrap":false}},"readme":"# cli-truncate\n\n> Truncate a string to a specific width in the terminal\n\nGracefully handles [ANSI escapes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles). Like a string styled with [`chalk`](https://github.com/chalk/chalk). It also supports Unicode surrogate pairs and fullwidth characters.\n\n## Install\n\n```sh\nnpm install cli-truncate\n```\n\n## Usage\n\n```js\nimport cliTruncate from 'cli-truncate';\n\ncliTruncate('unicorn', 4);\n//=> 'uni…'\n\n// Truncate at different positions\ncliTruncate('unicorn', 4, {position: 'start'});\n//=> '…orn'\n\ncliTruncate('unicorn', 4, {position: 'middle'});\n//=> 'un…n'\n\ncliTruncate('unicorns rainbow dragons', 6, {position: 'end'});\n//=> 'unico…'\n\ncliTruncate('\\u001B[31municorn\\u001B[39m', 4);\n//=> '\\u001B[31muni…\\u001B[39m'\n\n> [!NOTE]\n> When truncating styled text (ANSI escapes), the truncation character inherits the style at the breaking point for `position: 'start'` and `position: 'end'`. This does not apply to `position: 'middle'`.\n\n// Truncate Unicode surrogate pairs\ncliTruncate('uni\\uD83C\\uDE00corn', 5);\n//=> 'uni\\uD83C\\uDE00…'\n\n// Truncate fullwidth characters\ncliTruncate('안녕하세요', 3);\n//=> '안…'\n\n// Truncate the paragraph to the terminal width\nconst paragraph = 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.';\ncliTruncate(paragraph, process.stdout.columns);\n//=> 'Lorem ipsum dolor sit amet, consectetuer adipiscing…'\n```\n\n## API\n\n### cliTruncate(text, columns, options?)\n\n#### text\n\nType: `string`\n\nThe text to truncate.\n\n#### columns\n\nType: `number`\n\nThe number of columns to occupy in the terminal.\n\n#### options\n\nType: `object`\n\n##### position\n\nType: `string`\\\nDefault: `'end'`\\\nValues: `'start' | 'middle' | 'end'`\n\nThe position to truncate the string.\n\n##### space\n\nType: `boolean`\\\nDefault: `false`\n\nAdd a space between the text and the ellipsis.\n\n```js\nimport cliTruncate from 'cli-truncate';\n\ncliTruncate('unicorns', 5, {space: false});\n//=> 'unic…'\n\ncliTruncate('unicorns', 5, {space: true});\n//=> 'uni …'\n\ncliTruncate('unicorns', 6, {position: 'start', space: true});\n//=> '… orns'\n\ncliTruncate('unicorns', 7, {position: 'middle', space: true});\n//=> 'uni … s'\n```\n\n##### preferTruncationOnSpace\n\nType: `boolean`\\\nDefault: `false`\n\nTruncate the string from a whitespace if it is within 3 characters from the actual breaking point.\n\n```js\nimport cliTruncate from 'cli-truncate';\n\ncliTruncate('unicorns rainbow dragons', 20, {position: 'start', preferTruncationOnSpace: true});\n//=> '…rainbow dragons'\n\n// Without preferTruncationOnSpace\ncliTruncate('unicorns rainbow dragons', 20, {position: 'start'});\n//=> '…rns rainbow dragons'\n\ncliTruncate('unicorns rainbow dragons', 20, {position: 'middle', preferTruncationOnSpace: true});\n//=> 'unicorns…dragons'\n\ncliTruncate('unicorns rainbow dragons', 6, {position: 'end', preferTruncationOnSpace: true});\n//=> 'unico…'\n\n// preferTruncationOnSpace has no effect if space isn't found within 3 characters\ncliTruncate('unicorns rainbow dragons', 6, {position: 'middle', preferTruncationOnSpace: true});\n//=> 'uni…ns'\n```\n\n##### truncationCharacter\n\nType: `string`\\\nDefault: `…`\n\nThe character to use at the breaking point.\n\n```js\nimport cliTruncate from 'cli-truncate';\n\ncliTruncate('unicorns', 5, {position: 'end'});\n//=> 'unic…'\n\ncliTruncate('unicorns', 5, {position: 'end', truncationCharacter: '.'});\n//=> 'unic.'\n\ncliTruncate('unicorns', 5, {position: 'end', truncationCharacter: ''});\n//=> 'unico'\n```\n\n## Related\n\n- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes\n- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes\n","_attachments":{},"homepage":"https://github.com/sindresorhus/cli-truncate#readme","bugs":{"url":"https://github.com/sindresorhus/cli-truncate/issues"},"license":"MIT"}