Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cawfree/ink-remote
Serve an Ink application via Express.
https://github.com/cawfree/ink-remote
cli express ink react server xterm
Last synced: 3 days ago
JSON representation
Serve an Ink application via Express.
- Host: GitHub
- URL: https://github.com/cawfree/ink-remote
- Owner: cawfree
- License: mit
- Created: 2022-08-16T19:54:38.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-22T10:14:07.000Z (about 2 years ago)
- Last Synced: 2024-09-22T01:38:25.857Z (about 2 months ago)
- Topics: cli, express, ink, react, server, xterm
- Language: CSS
- Homepage:
- Size: 77.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ink-remote
Serve an [__Ink__](https://github.com/vadimdemedes/ink) application via [__Express__](https://github.com/expressjs/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 👶[__Check it out!__ 👀](https://twitter.com/cawfree/status/1559674440430063616)
### 🚀 getting started
Install using [__Yarn__](https://yarnpkg.com/):
```shell
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`:
```diff
import * as React from "react";- import {Text, render} from "ink";
+ import {Text} from "ink";
+ import {render} from "ink-remote";- render();
+ render(, {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`](http://localhost:3000`). The content is rendered using [__XTerm__](https://github.com/xtermjs/xterm.js/), whose fully-featured renderer is capable of presenting your application faithfully.
### ✌️ license
[__MIT__](./LICENSE)