Socket
Book a DemoInstallSign in
Socket

ink-process

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ink-process

> Use the https://npm.im/ink react renderer to manage exiting processes.

latest
npmnpm
Version
1.0.3
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

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 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(
  <Process
    render={(exitCode, onExit) => {
      if (exitCode === null) {
        return <App onExit={onExit} />;
      }
      return (
        <ExitProcess
          withCode={exitCode}
          renderBeforeExit={() => <Text>Exiting now with exit code {exitCode}</Text>}
        />
      );
    }}
  />
);

FAQs

Package last updated on 21 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts