ink-ansi
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

ink-ansi

An alternative text component that avoids rendering control characters that mess with the layout in ink. It unfortunately also strips out any emoji, because ink is not able to correctly measure & thus layout text that includes emoji.

This is useful if you want to render the output of other terminal applications.

Build Status Rolling Versions NPM version

Demo

The demo in src/demo.tsx renders this

GIF showing ink-ansi fixing inconsistent rendering

On the left is what gets rendered by ink-ansi. You can see it mosty maintaining the correct layout. On the right is what is rendered with Ink's built in Text element. The control sequences, newlines, tabs etc. all break the layout.

Installation

yarn add ink-ansi

Usage

import AnsiText from 'ink-ansi';

// use <AnsiText> anwywhere you previously used <Text>

Readme

Keywords

none

Package Sidebar

Install

npm i ink-ansi

Weekly Downloads

1,059

Version

1.0.0

License

MIT

Unpacked Size

2.85 MB

Total Files

22

Last publish

Collaborators

  • forbeslindesay
  • ink-ansi-bot