npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

openwebshell

v1.0.6

Published

A simple shell for your website or webapp.

Downloads

8

Readme

:shrimp: Open Web Shell

npm version test Known Vulnerabilities build passing License: MIT Sourcegraph

Open web shell is a small and simple terminal/shell for your react web app or react website.

Installation

npm install openwebshell

make sure to install the google ubuntu font so things look perfect


<link href="https://fonts.googleapis.com/css?family=Ubuntu+Mono" rel="stylesheet">

Then import!


import { Shell } from 'openwebshell';

Usage

Open shell is simple yet can be set up to control entire web apps or sites if given the right functions. Open shell executes users provided functions in a sane and predictable manner. Given this there are 3 props that shell takes.

Props

| PropName | Type | | ------------- | ------:| | config | Object | | functionList | Array | | styles | Object |

config

Defines functional configuration of the shell

| Name | Type | Description | |------------------|---------|---------------------------------------:| | defaultError | string | Sets error message on failed command | | terminal | string | Sets terminal input text ("C:") | | charMax | num | Sets limit on input length | | defaultFunctions | bool | Enables or disables provided functions |

functionList

Defines user provided functions for shell. Shell includes some functions by default, these can be disabled though config.


const list = [
    {
        //name to call the function
        name: "function that sums two inputs",
        options: {
            //define what each flag does they will be passed into func below
            t: (e)=>e,
            d: (e)=>e
        },
        def: (e)=>{
            //default function when no flags or func is not defined
            return "Please provide proper flags" 
        },
        func: (e)=>{
            //if flags are used the arguments will contain objects with their key set to the flag
            //in this case t or d 
            //if flags are defined in options and a command is called with a parameter. the parameter will be passed to this function.
            return e.t||e.d||e;
        }
    }
]

Can I specify the same flag more than once?

No. The first instance of the flag will be the only one passed. if you want to pass more than one option on a single flag use the flag function to split the input on the flag. (e)=>e.split(" ")

Can I use functions defined in react components?

Yes make sure you pass either the correct context to the function list or pass bound components into your list.

Can I use redux?

Yes just provide the correct context.

You can check out more advanced examples in the Style Guide

styles

Currently limited styles can be overwritten in this component. All set styles use standard 'css in js object' notation. All avaliable options and there defaults:


const styles = {
    fontFamily: "'Ubuntu Mono', monospace;",
    width: "100%",
    height: "100%",
    color: "green",
    backgroundColor: "black",
}

Dependencies

  • React: "^16.8.0"
  • styled-components: "^4.2.0",
  • prop-types: "^15.7.2",

Releases:

In Developement:

V: 1.0.6

  • Fixed cursor when used on Edge browsers
  • Fixed tests not finding modules in travis
  • Fixed spacing on output elements
  • Fixed changing style color not changing the output lines color
  • Fixed maxChar not working in config
  • fixed proptypes not working properly

Current:

v: 1.0.4/1.0.5

  • Move dependencies to peer dependencies
  • add new Styles (font-size)
  • added startUp command options in funcs
  • added command description, and flag descriptions
  • added help command in default functions
  • fixed incorrect license in Package.json
  • small changes to internal package layout
  • tests for styled components added

v: 1.0.3

  • fixed spelling errors
  • fixed a small bug in the focus function
  • fixed bug where output lines were not aligned properly