Skip to content
Render a scrollable terminal log in your ink app
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.editorconfig
.gitignore
.travis.yml
HISTORY.md
LICENSE.md
README.md
ink-console.gif
package.json
tsconfig.json

README.md

ink-console

Render a scrollable terminal log in your ink app

Build Status Dependency Status NPM version

Demo

Installation

npm install ink-console --save

Basic Usage

import {h, render} from 'ts-ink';
import Console from 'ink-console';
import Counter from './Counter';

render(
  <div>
    <Counter />
    <br />
    <Console lines={20} />
  </div>,
);

Advanced Usage

import {h, render} from 'ts-ink';
import Console, {LogCatcher} from 'ink-console';
import Counter from './Counter';

// defining the log catcher outside the component
// lets you render the same global console.log in
// multiple separate locations
// e.g. you can preserve the log even if it is not always visible
const logCatcher = new LogCatcher();

render(
  <div>
    <Counter />
    <br />
    <Console lines={20} logCatcher={logCatcher} />
  </div>,
);

License

MIT

You can’t perform that action at this time.