expandtabs
v1.0.0
Published
Javascript version of expandtabs
Downloads
49
Readme
expandtabs
Javascript version of expandtabs
Return a copy where all tab characters are expanded using spaces.
This code bases on an article in Chris West's Blog : JavaScript – String.prototype.expandTabs() Revisited.
Support fullwidth characters and ANSI escape codes.
Install
$ npm install expandtabs
Usage
const expandTabs = require('expandtabs');
expandTabs('aaa\tbbb');
//=> aaa bbb
API
expandTabs(string, tabSize?)
string
Type: string
String need to be expanded.
tabSize
Type: number
Default: 8
Size of a tab.