# dedented

> Utility to remove indentation from strings

Latest version **1.0.0** (published 2023-04-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install dedented
pnpm add dedented
yarn add dedented
bun add dedented
```

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-04-17 |
| First published | 2023-04-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | zmrl |
| Maintainers | zmrl |
| Keywords | text, utility, dedent, deindent, tagged-template |

## Links

- npm: https://www.npmjs.com/package/dedented
- Repository: https://github.com/zmrl010/dedented
- Homepage: https://github.com/zmrl010/dedented#readme
- Issues: https://github.com/zmrl010/dedented/issues
- npm.io page: https://npm.io/package/dedented

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2023-04-17

## README

# Dedent(ed)

A simple utility that strips indentation from multi-line strings.

## 👉 Features 👈

* Strip indentation from multi-line strings
* Tagged template literal syntax
* Function call syntax
* Developed in TypeScript for complete typing support
* Exports ECMAScript module (ESM)

## 🏗 Install

Install with your favorite package manager

```shell
pnpm add dedented
# or 
npm add dedented
# or 
yarn add dedented
```

## 💻 Usage

Simply import the function and use it!

```ts
import { dedent } from 'dedented';

const value = dedent`Lorem ipsum dolor sit amet, consectetur
                     adipiscing elit. Curabitur ac est imperdiet, 
                     ullamcorper ex eu, dapibus felis. Quisque 
                     vitae leo non arcu viverra tristique id vitae 
                     nibh. 

                      * Suspendisse condimentum volutpat condimentum. 
                      * Interdum et malesuada fames ac ante ipsum primis in faucibus. 
                      * Nullam posuere accumsan ipsum a rutrum. 
                  
                     Etiam imperdiet justo eu commodo varius. Quisque pharetra 
                     aliquam vulputate.`

console.log(value)
```

You'll see that `value` evaluates to the same text you entered, but with any leading indentation stripped from each line:

```text
Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Curabitur ac est imperdiet, 
ullamcorper ex eu, dapibus felis. Quisque 
vitae leo non arcu viverra tristique id vitae 
nibh. 

 * Suspendisse condimentum volutpat condimentum. 
 * Interdum et malesuada fames ac ante ipsum primis in faucibus. 
 * Nullam posuere accumsan ipsum a rutrum. 

Etiam imperdiet justo eu commodo varius. Quisque pharetra 
aliquam vulputate.
```

## Credits

This library draws heavily from:

* [ts-dedent](https://github.com/tamino-martinius/node-ts-dedent) (test suite and implementation)
* [dedent](https://github.com/dmnd/dedent) (inspiration)

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