Skip to content

vadimdemedes/convert-to-tabs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

convert-to-tabs Build Status

Convert tabs to spaces in a string

Install

$ npm install --save convert-to-tabs

Usage

const convertToTabs = require('convert-to-tabs');

convertToTabs('    hello');
//=> '\t\thello'

convertToTabs('    hello', 4);
//=> '\thello'

API

convertToTabs(str, [spaces])

str

Type: string

Source string.

spaces

Type: number
Default: 2

Number of spaces to treat as one tab.

Related

License

MIT © Vadim Demedes

About

Convert spaces to tabs in a string

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published