Skip to content

Latest commit

 

History

History
19 lines (15 loc) · 345 Bytes

README.md

File metadata and controls

19 lines (15 loc) · 345 Bytes

terminal-text-width

Get the number of columns occupied by specified text in terminal.

Install

$ npm install terminal-text-width --save

Usage

var getTextWidth = require('terminal-text-width');
getTextWidth("hi")        //-> 2
getTextWidth("你好")       //-> 4
getTextWidth("안녕하세요")  //->10

License

MIT