convert-to-spaces

Convert tabs to spaces in a string

MIT 5 个版本
安装
npm install convert-to-spaces
yarn add convert-to-spaces
pnpm add convert-to-spaces
bun add convert-to-spaces
README

convert-to-spaces Build Status

Convert tabs to spaces in a string

Install

$ npm install --save convert-to-spaces

Usage

import convertToSpaces from 'convert-to-spaces';

convertToSpaces('\t\thello!');
//=> '    hello!'

API

convertToSpaces(input, [spaces])

input

Type: string

String to convert.

spaces

Type: number
Default: 2

Number of spaces instead of each tab.

版本列表
2.0.1 2022-02-06
2.0.0 2022-02-06
1.0.2 2017-02-23
1.0.1 2016-11-13
1.0.0 2016-11-13