detab
Detab: tabs -> spaces
Last updated 6 years ago by wooorm .
MIT · Repository · Bugs · Original npm
$ cnpm install detab 
SYNC missed versions from official npm registry.

detab

Build Coverage Downloads 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

Current Tags

  • 3.0.1                                ...           latest (4 years ago)

4 Versions

  • 3.0.1                                ...           4 years ago
  • 3.0.0                                ...           4 years ago
  • 2.0.4                                ...           5 years ago
  • 2.0.3                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (8)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org