8000 GitHub - Souvikns/ink-router-cli: A react-router style CLI parser for InkJS.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Souvikns/ink-router-cli

Repository files navigation

Ink-Router-Cli

GitHub license GitHub license DeepScan grade npm

ink-cli-parser

ink-cli-parser is a cli parser tool that is built just for ink. You can pass in you custom ink help component and error component.

Table Of Contents

Getting Started

To install ink-cli-parser, ensure that you have Node.js >=10. Install nodejs from here

Installation

The easiest way to install ink-cli-parser is using NPM. If you have Node.js installed, it is most likely that you have NPM installed as well

$ npm install ink-cli-parser

Usage

import React, { FC } from "react";
import { Router, Switch, Command } from "ink-cli-router";
import { render, Text } from "ink";

const Create = () => {
  return <Text>{"Creating file"}</Text>;
};

const App: FC<{ any }> = () => {
  return (
    <Router argv={process.argv}>
      <Switch>
        <Command name="create" component={<Create />} />
      </Switch>
    </Router>
  );
};

render(<App />);

ss


Api Reference

To read more about the API you can visit here

About

A react-router style CLI parser for InkJS.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
0