Skip to content

glebbash/multiline-str

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

multiline-str

Source Deploy Coverage Status

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

Installation

Node

npm i panic-fn

Deno

import { m } from "https://deno.land/x/multiline_str/mod.ts";

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 |more important stuff
will be removed |the most important stuff         
                |`);

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

Module info

This module was created using denoland/dnt.

This project is Mit Licensed.