multiline-str

Strip indentation of multiline strings in based on length of the last line.

Usage no npm install needed!

<script type="module">
  import multilineStr from 'https://cdn.skypack.dev/multiline-str';
</script>

README

multiline-str

Deploy Coverage Status

Strip indentation of multiline strings based on length of the last line.

Installation:

npm i multiline-str

Usage

import { m } from 'multiline-str';

console.log(m`
    Indentation is magically removed.
    No more whitespace junk before text.
    `);

console.log(m`
          You control indentation with the length of the last line
this ---> `);

console.log(m`
                |Important stuff
everything else |bla
will be removed |bla         
                |`);

console.log(m`
001 | You can even 
002 | do some
003 | weird things
*** | `);

Bootstrapped with: create-ts-lib-gh

This project is Mit Licensed.