Options
All
  • Public
  • Public/Protected
  • All
Menu

README

NPM

Purpose

Unixorn aspires to be a Unix-like environment with a shell interface that:

  • can be embedded into a website

  • comes with a set of built-in commands and keybindings

  • can be extended with additional commands, keybindings and styles

You can view a live example of Unixorn in action.

Installation

Execute yarn add unixorn.

Basic Usage

In React

import React, { Component } from 'react'

import Unixorn from 'unixorn'

const configuration = {}

class Example extends Component {
  render() {
    return <Unixorn {...configuration} />
  }
}

Without React

import { initUnixorn } from 'unixorn'

const configuration = {}

const nonReactDomNode = document.getElementById('example')

initUnixorn(nonReactDomNode, configuration)

APIs

Typescript Exports

Consult the docs generated with typedoc.

CSS Classes

The following classes may be targeted for styling:

  • unixorn-base
  • unixorn-current
  • unixorn-cursor
  • unixorn-error
  • unixorn-input
  • unixorn-output
  • unixorn-prompt
  • unixorn-startup-message

Development

To install dependencies

Execute yarn install.

To build

Execute yarn run build.

To run

Execute yarn start.

To regenerate docs

Execute yarn docs.

To run the example app

Execute yarn install and yarn start in the example folder.

To run the test suite and linter

Execute yarn test.

Index

Variables

Const Unixorn

Unixorn: React.FunctionComponent<UnixornConfiguration> = ...

The main component.

Const defaultConfiguration

defaultConfiguration: UnixornConfiguration = ...

Defaults that a new Unixorn component will be initialized with if its props are not set.

Functions

Const initUnixorn

  • Attach a new Unixorn component to an existing DOM node.

    Parameters

    • element: HTMLElement

      The DOM node to which the new Unixorn component should be attached.

    • Optional configuration: UnixornConfiguration

      Props to be passed to the new Unixorn component.

    Returns void

Legend

  • Property

Generated using TypeDoc