convert-to-tabs

1.0.3 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i convert-to-tabs

Weekly Downloads

1

Version

1.0.3

License

MIT

Last publish

Collaborators

  • vdemedes