Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

readme.md 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # string-width [![Build Status](https://travis-ci.org/sindresorhus/string-width.svg?branch=master)](https://travis-ci.org/sindresorhus/string-width)
  2. > Get the visual width of a string - the number of columns required to display it
  3. Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.
  4. Useful to be able to measure the actual width of command-line output.
  5. ## Install
  6. ```
  7. $ npm install string-width
  8. ```
  9. ## Usage
  10. ```js
  11. const stringWidth = require('string-width');
  12. stringWidth('古');
  13. //=> 2
  14. stringWidth('\u001b[1m古\u001b[22m');
  15. //=> 2
  16. stringWidth('a');
  17. //=> 1
  18. ```
  19. ## Related
  20. - [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module
  21. - [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string
  22. - [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string
  23. ## License
  24. MIT © [Sindre Sorhus](https://sindresorhus.com)