4.0.1 • Published 3 years ago

widest-line v4.0.1

Weekly downloads
11,249,379
License
MIT
Repository
github
Last release
3 years ago

widest-line

Get the visual width of the widest line in a string - the number of columns required to display it

Some Unicode characters are fullwidth and use double the normal width. ANSI escape codes are stripped and doesn't affect the width.

Useful to be able to know the maximum width a string will take up in the terminal.

Install

npm install widest-line

Usage

import widestLine from 'widest-line';

widestLine('古\n\u001B[1m@\u001B[22m');
//=> 2

Related

boxenarchetype-librarycomponennentteasy-select-rnreact-native-bluetooth2killi8n-react-native-fast-image@cashremit/cr-streamline-iconsairscanairscan-examplereact-native-esc-pos-sahaab@borisovart/atol-kkt-moduledeneme323112@ntt_app/react-native-custom-notificationdiscord-music-botsreact-native-covid-sdk@saeon/quick-formmysql-formatreact-native-printer-brothersreact-native-shekhar-bridge-testcogoportutilsdyx-react@oiti/documentoscopy-react-nativequoc-testunblock-block-save-variables@infinitebrahmanuniverse/nolb-wid@saaspe/componentsluminos-ui-corejawwy-sdkjawwy_gamification_release@everything-registry/sub-chunk-3146react-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgink-prismreact-native-jawwy_sampleglobal_components_assignmentgriffin-ui-librarykhaled-salem-custom-componentsm2m-chartjs-plugin-crosshairmama-exporterlq-server-clihardhat-teaplughardhat-teaxyzgundam5hexyun.helpershubot-budahw9hong1-utilsinkink-cjsitronjametjordy-frijters-test-libjrennsoh88-react-native-scroll-indicatormiracle-webpack-tree-shakingnative-apple-loginnew-awesome-4321my-vue-termuinative-google-loginnative-date-picker-modulenative-modal-damage-vehiclenative-kakao-loginmpesa-cookieng-search-dropdownmpesa-cookie-jarnpm-custom-lib-resuenpmtest-05041@samwinslow/edgedb@react-native-ui-design/button@rizzlesauce/oclif-plugin-help@satrianak/hardhat-teaxyz@praella/localisationist@podlubnaja/ui-kit@thinxviewx/core-rn@tonysusi/vapid@taingo97/react-native-awesome-module@taingo97/react-native-bluetooth-xprinter@taingo97/react-native-expo-key-rsa-kt@taingo97/react-native-expo-rsa@taingo97/react-native-generate-key-rsa@taingo97/react-native-key-rsa@taingo97/react-native-print-xprinter@taingo97/react-native-rsa@taingo97/react-native-rsa-expo@taingo97/react-native-sunmi-printer@taingo97/react-native-telpo-printer@temir/core@terrastack/ink@saad27/react-native-bottom-tab-tour@saeon/logger@unboundedsystems/plugin-help@sidghimire/react-native-mapbox-navigation@plogg/three@sephriot/react-native-persistable-uri@skeetboothppq/component-library@skedulr/nebula-ui-library@rectangulr/rectangulr@shivarajapple/first-library@status-im/react-native-transparent-video
4.0.1

3 years ago

4.0.0

3 years ago

3.1.0

5 years ago

3.0.0

5 years ago

2.0.1

6 years ago

2.0.0

7 years ago

1.0.0

9 years ago