New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@webscopeio/react-console

Package Overview
Dependencies
Maintainers
5
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webscopeio/react-console

React component that emulates console behaviour

  • 1.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-77.42%
Maintainers
5
Weekly downloads
 
Created
Source

MIT-licensed console emulator in React. Documentation and more advanced features coming soon!

react-console

React component that emulates console behaviour

NPM JavaScript Style Guide

Install

npm install --save @webscopeio/react-console

Demo

https://webscopeio.github.io/react-console/

Screenshot

Webscope React Console

Props

PropsTypeDescription
commands*Object
promptstring
welcomeMessagestring
autoFocusboolean
noCommandFound(...str: string[]) => Promise
wrapperStyleObjectstyles for the wrapper
promptStyleObjectstyles for the prompt
inputStyleObjectstyles for the input
wrapperClassNamestringclassName for the wrapper
promptClassNamestringclassName for the prompt
inputClassNamestringclassName for the input

*are mandatory

Usage

import React, { Component } from 'react'

import ReactConsole from 'react-console'

export default class App extends Component {
  render () {
    return (
      <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

MIT © jvorcak

FAQs

Package last updated on 30 Jul 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc