ink-remote
Serve an Ink application via Express, so you can check on your application remotely when you don't feel like getting up from off your couch since you run the risk of waking your baby
🚀 getting started
Install using Yarn:
yarn add ink-remote xterm xterm-addon-fit
Then just swap out ink
's included render
function for the alternative render
method exported by ink-remote
:
import * as React from "react";
- import {Text, render} from "ink";
+ import {Text} from "ink";
+ import {render} from "ink-remote";
- render(<Text children="Hello, world!" />);
+ render(<Text children="Hello, world!" />, {port: 3000});
In this instance, not only will your application will be rendered in the CLI like usual, but it will also be accessible via http://localhost:3000
. The content is rendered using XTerm, whose fully-featured renderer is capable of presenting your application faithfully.