# gw-text

> Color embedded text templating, formatting, and utilities

Latest version **1.0.10** (published 2020-12-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install gw-text
pnpm add gw-text
yarn add gw-text
bun add gw-text
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.10 |
| Published | 2020-12-08 |
| First published | 2020-11-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 89.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Funnisimo |
| Maintainers | funnisimo |
| Keywords | text, template |

## Links

- npm: https://www.npmjs.com/package/gw-text
- Repository: https://github.com/funnisimo/gw-text
- Homepage: https://github.com/funnisimo/gw-text#readme
- Issues: https://github.com/funnisimo/gw-text/issues
- npm.io page: https://npm.io/package/gw-text

## Alternatives

- [ext-list](https://npm.io/package/ext-list.md) — 6.3M weekly downloads
- [@lexical/selection](https://npm.io/package/@lexical/selection.md) — 3.8M weekly downloads
- [@lexical/text](https://npm.io/package/@lexical/text.md) — 3.6M weekly downloads
- [@lexical/clipboard](https://npm.io/package/@lexical/clipboard.md) — 3.0M weekly downloads
- [@tiptap/extension-mention](https://npm.io/package/@tiptap/extension-mention.md) — 3.0M weekly downloads

## Recent versions

- 1.0.10 (latest) — 2020-12-08
- 1.0.9 — 2020-11-30
- 1.0.7 — 2020-11-28
- 1.0.6 — 2020-11-28
- 1.0.5 — 2020-11-28
- 1.0.3 — 2020-11-28
- 1.0.1 — 2020-11-27

## README

# gw-text

Utilities for working with color embedded strings and templates.

## Why use it?

If you want to store message configuration that will later be filled in when the data is available.  It is especially helpful if you are trying to encode color information into your messages and want to later process them a character at a time.

```js
const template = GW.text.compile('The ΩredΩ§actor§∆ ate the ΩgreenΩ§food§∆.');
const message  = template({ actor: 'Fox', food: 'Chicken' });

// message = 'The ΩredΩFox∆ ate the ΩgreenΩChicken∆.'

GW.text.eachChar(message, (ch, i, fg, bg) => {
  drawChar(x + i, y, ch, fg, bg);
});
```

There are some other bells and whistles on top of this, but this usage pattern is the main point.

## Manual

For more information, please see the [Manual](https://funnisimo.github.io/gw-text).

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