Convert tabs to spaces in a string
$ npm install --save convert-to-tabs
const convertToTabs = require('convert-to-tabs');
convertToTabs(' hello');
//=> '\t\thello'
convertToTabs(' hello', 4);
//=> '\thello'
Type: string
Source string.
Type: number
Default: 2
Number of spaces to treat as one tab.
- convert-to-spaces - Convert tabs to spaces.
MIT © Vadim Demedes