Nautical Pirate Moustache

    detab
    TypeScript icon, indicating that this package has built-in type declarations

    3.0.1 • Public • Published

    detab

    Build Coverage Downloads Size

    Detab: tabs → spaces.

    Install

    This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required.

    npm:

    npm install detab

    Use

    import {detab} from '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

    This package exports the following identifiers: detab. There is no default export.

    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

    Install

    npm i detab

    DownloadsWeekly Downloads

    3,569,239

    Version

    3.0.1

    License

    MIT

    Unpacked Size

    5.74 kB

    Total Files

    5

    Last publish

    Collaborators

    • wooorm