Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/glebbash/multiline-str
Convenient multiline strings for JavaScript
https://github.com/glebbash/multiline-str
dedent identation javascript typescript
Last synced: about 2 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 (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-09-22T15:43:17.000Z (over 2 years ago)
- Last Synced: 2024-10-28T12:17:00.546Z (about 2 months ago)
- Topics: dedent, identation, javascript, typescript
- Language: TypeScript
- Homepage: https://glebbash.github.io/multiline-str/
- Size: 287 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# multiline-str
[![Source](https://img.shields.io/badge/source-github-informational)](https://github.com/glebbash/multiline-strn)
[![Deploy](https://github.com/glebbash/multiline-str/workflows/build/badge.svg)](https://github.com/glebbash/multiline-str/actions)
[![Coverage Status](https://coveralls.io/repos/github/glebbash/multiline-str/badge.svg?branch=master)](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).