npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

convert-to-tabs

1.0.3

@vdemedes

npmHomeRepoSnykSocket
Downloads:25
$ npm install convert-to-tabs
DailyWeeklyMonthlyYearly

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

  • convert-to-spaces - Convert tabs to spaces.

License

MIT © Vadim Demedes