/widest-string

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

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

Welcome to widest-string 👋

Version Documentation Maintenance License: GPL-3.0 Downloads

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

Install

npm install

Usage

const widestString = require('widest-string');

console.log(widestString([
'Hello',
'Hello World',
'Hello\nWorld'
])) // 11, because 'Hello World' has 11 symols

Run tests

npm run test

Author

👤 Grigorii Horos

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2019 Grigorii Horos.

This project is GPL-3.0-or-later licensed.


This README was generated with ❤️ by readme-md-generator