Projects STRLCPY kitsec-core Files
🤬
..
index.js Loading last commit info...
license
package.json
readme.md
readme.md

detab

[Build]build [Coverage]coverage [Downloads]downloads [Size]size

Detab: tabs → spaces.

Install

npm:

npm install detab

Use

var detab = require('detab')

console.log(detab('\tfoo\nbar\tbaz'))
console.log(detab('\tfoo\nbar\tbaz', 2))
console.log(detab('\tfoo\nbar\tbaz', 8))

Yields:

    foo
bar baz
  foo
bar baz
        foo
bar     baz

API

detab(value[, size=4])

Replace tabs with spaces in value (string), being smart about which column the tab is at and which size (number, default: 4) should be used.

License

MIT © Titus Wormer

Please wait...
Page is in error, reload to recover