Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jvorcak authored Nov 23, 2018
1 parent f350e36 commit a76f443
Showing 1 changed file with 33 additions and 5 deletions.
38 changes: 33 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,51 @@
## Install

```bash
npm install --save react-console
npm install --save @webscopeio/react-console
```

## Usage

```tsx
import * as React from 'react'
import React, { Component } from 'react'

import MyComponent from 'react-console'
import ReactConsole from 'react-console'

class Example extends React.Component {
export default class App extends Component {
render () {
return (
<MyComponent />
<div>
<ReactConsole
autoFocus
welcomeMessage="Welcome"
commands={{
echo: {
description: 'Echo',
fn: (...args) => {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(`${args.join(' ')}`)
}, 2000)
})
}
},
test: {
description: 'Test',
fn: (...args) => {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve('Hello world \n\n hello \n')
}, 2000)
})
}
}
}}
/>
</div>
)
}
}

```

## License
Expand Down

0 comments on commit a76f443

Please sign in to comment.