Convert tabs to spaces in a string
npm install convert-to-spaces
yarn add convert-to-spaces
pnpm add convert-to-spaces
bun add convert-to-spaces
$ npm install --save convert-to-spaces
import convertToSpaces from 'convert-to-spaces'; convertToSpaces('\t\thello!'); //=> ' hello!'
Type: string
string
String to convert.
Type: number Default: 2
number
2
Number of spaces instead of each tab.