Skip to content

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

Notifications You must be signed in to change notification settings

letiantian/terminal-text-width

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published