tab-to-space

1.0.1 • Public • Published

Tabs to Spaces

Convert a string containing tabs to appropriate number of spaces.

JavaScript Style Guide

Version npm NPM Downloads License GitHub Repository Size JavaScript Style Guide Travis (.org) branch

NPM

Installation

Either through cloning with git or by using npm (the recommended way):

npm install tab-to-space

Usage

const tabToSpace = require('tab-to-space')
 

Use var_dump while development for printing details of variables and functions.

let text = '\t\t[FirstName]\t\t\t\t=> TEST\n' +
      '        [LastName]              => TEST\n'
 
// convert tabs to spaces
tabToSpace(text, 4)

This will return:

'        [FirstName]             => TEST\n' +
'        [LastName]              => TEST\n'
 

Package Sidebar

Install

npm i tab-to-space

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

80.4 kB

Total Files

7

Last publish

Collaborators

  • ankurnarkhede