https://github.com/jimthedev/ink-process
Exit Node processes declaratively in Ink
https://github.com/jimthedev/ink-process
Last synced: 3 months ago
JSON representation
Exit Node processes declaratively in Ink
- Host: GitHub
- URL: https://github.com/jimthedev/ink-process
- Owner: jimthedev
- Created: 2017-11-21T03:44:35.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-21T03:45:53.000Z (over 7 years ago)
- Last Synced: 2025-01-17T03:43:06.813Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ink-process
> Use the https://npm.im/ink react renderer to manage exiting processes.
## Install
```
npm install --save ink-process
```You'll also need to make sure you've installed [ink](https://npm.im/ink) and set up babel with babel-plugin-transform-react-jsx.
## Usage
```
const { h, render, Component, Text } = require("ink");
const {ExitProcess, Process} = require('ink-process');class App extends Component {
//... Your ink app here
// can call this.props.onExit(0)
//... or
// this.props.onExit(1)
}render(
{
if (exitCode === null) {
return ;
}
return (
Exiting now with exit code {exitCode}}
/>
);
}}
/>
);
```