Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

convert-to-tabs

vadimdemedes3MIT1.0.3

Convert tabs to spaces in a string

tabs, spaces

readme

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.

License

MIT © Vadim Demedes