# @timhall/dedent

> Remove extra indentation from template strings

Latest version **0.10.0** (published 2021-02-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @timhall/dedent
pnpm add @timhall/dedent
yarn add @timhall/dedent
bun add @timhall/dedent
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.10.0 |
| Published | 2021-02-06 |
| First published | 2019-10-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 17.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Desmond Brand |
| Maintainers | timhall |
| Keywords | dedent, indent, template, strings |

## Links

- npm: https://www.npmjs.com/package/@timhall/dedent
- Repository: https://github.com/timhall/dedent
- Issues: https://github.com/timhall/dedent/issues
- npm.io page: https://npm.io/package/@timhall/dedent

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 0.10.0 (latest) — 2021-02-06
- 0.9.1 — 2021-01-24
- 0.9.0 — 2020-10-25
- 0.8.2 — 2020-01-01
- 0.8.1 — 2019-10-19
- 0.8.0 — 2019-10-19

## README

# Dedent

An ES6 string tag that strips indentation from multi-line strings.

## Usage

```js
import dedent from 'dedent';

function usageExample() {
	const first = dedent`A string that gets so long you need to break it over
                       multiple lines. Luckily dedent is here to keep it
                       readable without lots of spaces ending up in the string
                       itself.`;

	const second = dedent`
    Leading and trailing lines will be trimmed, so you can write something like
    this and have it work as you expect:

      * how convenient it is
      * that I can use an indented list
         - and still have it do the right thing

    That's all.
  `;

	const third = dedent(`
    Wait! I lied. Dedent can also be used as a function.
  `);

	return first + '\n\n' + second + '\n\n' + third;
}
```

```js
> console.log(usageExample());
```

```
A string that gets so long you need to break it over
multiple lines. Luckily dedent is here to keep it
readable without lots of spaces ending up in the string
itself.

Leading and trailing lines will be trimmed, so you can write something like
this and have it work as you expect:

  * how convenient it is
  * that I can use an indented list
    - and still have it do the right thing

That's all.

Wait! I lied. Dedent can also be used as a function.
```

## License

MIT

---
_Source: https://npm.io/package/@timhall/dedent · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
