# ink-render-string

> Render string for ink components

Latest version **1.0.0** (published 2022-07-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install ink-render-string
pnpm add ink-render-string
yarn add ink-render-string
bun add ink-render-string
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-07-12 |
| First published | 2021-08-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 14 |
| Dependencies | 2 |
| Unpacked size | 13 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Zhan Wang |
| Maintainers | scalvert, zhanwang |

## Links

- npm: https://www.npmjs.com/package/ink-render-string
- Repository: https://github.com/zhanwang626/ink-render-string
- Homepage: https://github.com/zhanwang626/ink-render-string#readme
- Issues: https://github.com/zhanwang626/ink-render-string/issues
- npm.io page: https://npm.io/package/ink-render-string

## Dependencies (2)

- [ink](https://npm.io/package/ink.md) ^3.0.9
- [events](https://npm.io/package/events.md) ^3.3.0

## Recent versions

- 1.0.0 (latest) — 2022-07-12
- 0.1.0 — 2021-09-05
- 0.0.7 — 2021-09-05
- 0.0.6 — 2021-08-25
- 0.0.5 — 2021-08-25
- 0.0.4 — 2021-08-25
- 0.0.3 — 2021-08-25
- 0.0.2 — 2021-08-25
- 0.0.1 — 2021-08-24

## README

# ink-render-string

ink-render-string provides a render function which will return a string, which is the rendered content of the ink component you pass to the render function.

## Install

```bash
yarn add ink-render-string
```

## Usage

```tsx
import { render } from 'ink-render-string';
import { Text } from 'ink';

const Component = () => <Text>Hello World</Text>;

const { output, cleanup } = render(<Component />);
output.includes('Hello World'); //=> true

cleanup(); // cleans up outstanding render resources
```

The `render` function also returns a number of other instance properties:

- `output`: the rendered output
- `cleanup`: a function which cleans up outstanding render resources
- `unmount`: a function which unmounts the component
- `stdout`: the original stdout
- `stderr`: the original stderr
- `exitCode`: the original exit code
- `frames`: an array of rendered frames

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