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

1.0.1 • Public • Published

Dedent Tag

NPM version NPM downloads Build status Test coverage

ES2015 tagged template string for removing indent from strings.

Mirrors on textwrap.dedent, but ignores interpolated values. Why? You can embed dedented strings without breaking indent calculation.

Installation

npm install dedent-tag --save

Usage

import dedent from "dedent-tag";
 
const text = dedent`
  text
  with
  multiple
    lines
`; //=> "\ntext\nwith\nmultiple\nlines\n"
 
// End first line with `\` to avoid empty line!
const text = dedent`\
  more
  text
`; //=> "more\ntext\n"

License

MIT

/dedent-tag/

    Package Sidebar

    Install

    npm i dedent-tag

    Weekly Downloads

    131

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    16.4 kB

    Total Files

    9

    Last publish

    Collaborators

    • blakeembrey