# heredoc-tag

> Heredoc helpers for ES2015 template strings

Latest version **0.1.0** (published 2016-01-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install heredoc-tag
pnpm add heredoc-tag
yarn add heredoc-tag
bun add heredoc-tag
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2016-01-22 |
| First published | 2016-01-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | "Cowboy" Ben Alman |
| Maintainers | cowboy |
| Keywords | es2015, es6, heredoc, template, string |

## Links

- npm: https://www.npmjs.com/package/heredoc-tag
- Repository: https://github.com/cowboy/node-heredoc-tag
- Homepage: https:/github.com/cowboy/node-heredoc-tag
- Issues: https://github.com/cowboy/node-heredoc-tag/issues
- npm.io page: https://npm.io/package/heredoc-tag

## Dependencies (1)

- [babel-plugin-transform-runtime](https://npm.io/package/babel-plugin-transform-runtime.md) ^6.4.0

## 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.1.0 (latest) — 2016-01-22
- 0.0.2 — 2016-01-22
- 0.0.1 — 2016-01-22

## README

# heredoc-tag

> Heredoc helpers for ES2015 template strings

## Installation

```
npm install heredoc-tag
```

## Examples

_(Taken from the [examples](examples/examples.js) file)_

```js
import heredoc from 'heredoc-tag';
let str;


// Trim
str = heredoc.trim`

this is a test

`;
console.log(`"${str}"`); // "this is a test"


// Remove newlines
str = heredoc.oneline`
  Here is a sentence
  split across
  multiple lines.
`;
console.log(`"${str}"`); // "  Here is a sentence  split across  multiple lines."


// Remove newlines, trim each line, then join lines with a space
str = heredoc.oneline.trim`
  Here is a sentence
  split across
  multiple lines.
`;
console.log(`"${str}"`); // "Here is a sentence split across multiple lines."


// Unindent as far as possible
str = heredoc.unindent`
      This is an example
        where some text is indented more
      and some text is indented less
    for whatever reason.
`;
console.log(`"${str}"`);
// "
//   This is an example
//     where some text is indented more
//   and some text is indented less
// for whatever reason.
// "


// Unindent, trim the ends of lines, trim leading/trailing whitespace
str = heredoc.unindent.trim`
      This is an example
        where some text is indented more
      and some text is indented less
    for whatever reason.
`;
console.log(`"${str}"`);
// "  This is an example
//     where some text is indented more
//   and some text is indented less
// for whatever reason."
```

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