https://github.com/glebbash/multiline-str
Convenient multiline strings for JavaScript
https://github.com/glebbash/multiline-str
dedent identation javascript typescript
Last synced: 3 months ago
JSON representation
Convenient multiline strings for JavaScript
- Host: GitHub
- URL: https://github.com/glebbash/multiline-str
- Owner: glebbash
- License: mit
- Created: 2020-07-24T08:38:08.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-09-22T15:43:17.000Z (almost 4 years ago)
- Last Synced: 2025-10-23T04:55:01.735Z (9 months ago)
- Topics: dedent, identation, javascript, typescript
- Language: TypeScript
- Homepage: https://glebbash.github.io/multiline-str/
- Size: 287 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# multiline-str
[](https://github.com/glebbash/multiline-strn)
[](https://github.com/glebbash/multiline-str/actions)
[](https://coveralls.io/github/glebbash/multiline-str?branch=master)
Strip indentation of multiline strings based on length of the last line.
## Installation
### Node
```bash
npm i panic-fn
```
### Deno
```ts
import { m } from "https://deno.land/x/multiline_str/mod.ts";
```
## Usage
```ts
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](https://github.com/denoland/dnt).
This project is [Mit Licensed](LICENSE).