1.0.3 • Published 6 years ago

react-command-line v1.0.3

Weekly downloads
4
License
ISC
Repository
github
Last release
6 years ago

react-command-line

ReactCLI is a ReactJS component that provides a simple way to present a command line interface to your user in your web app.

You can view a live demo here.

Installation

npm install --save react-command-line
# or
yarn add react-command-line

Example Usage

The following will produce a terminal where the user can type "hello" to see a message containing the arguments passed to the function.

const commands = {
  hello: {
    fn: args => {
      return `The arguments are ${args}`
    }
  }
}

// ...

ReactDOM.render(
  <CommandLine commands={commands} />,
  document.getElementById('root')
);

Features

  • Stylable terminal that accepts synchronous and asynchronous commands

Ideas for future features

  • Automatically clearing buffer past certain number of lines
  • Supporting ANSI colors
1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago