glebbash / multiline-str

Convenient multiline strings for JavaScript

Home Page:https://glebbash.github.io/multiline-str/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

Convenient multiline strings for JavaScript

https://glebbash.github.io/multiline-str/

License:MIT License


Languages

Language:TypeScript 100.0%