Skip to content

bet4it/expandtabs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

expandtabs Build Status XO: Linted

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks