1.0.1 • Published 5 years ago

tab-to-space v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

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'