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

shellhub

v1.0.0

Published

A simple HTTP server to invoke shell scripts, typically used for git hooks.

Downloads

7

Readme

shellhub

NPM version Build Status Coverage Status Dependency manager

An HTTP server to provide streaming ports for shell scripts, typically used for git hooks.

Features:

This project is like, uh, CGI, but much easier to install and start running.

  • URL query passed as environment variables
  • Request body piped to STDIN
  • STDOUT piped to request body

Usage

npm i -g shellhub and make a shellhubrc.json in current directory:

{
    "host": "0.0.0.0",
    "port": 8888,
    "stack": true,
    "scripts": {
        "/hello/world": {
            "cwd": "/Users/harttle/src/shellhub/demo/",
            "cmd": "hello-world.sh"
        }
    }
}

Start shellhub with default shellhubrc.json in current directory:

$ shellhub

Open http://localhost:8888/hello/world in your favorite browser, or:

curl http://localhost:8888/hello/world

The output of hello-world.sh will be streamed to stdout.

Options

Name | Default | Description --- | --- | --- host | "localhost" | The host to bind with port | 8080 | The port to bind with stack | true | Whether or not print stack when there's an error scripts | {} | Map from pathname to shell entry, the pathname can be arbitrary string scripts.cwd | undefined | The work directory for the shell command, resolve based on the config file scripts.cmd | undefined | The shell command to run, which will be passed to bash -c

Q&A

Can I use a config other than ./shellhubrc.json?

$ shellhub -c path/to/your/shellhubrc.json

Where can I find the logs?

Logs are printed to STDOUT, with datetime and traceID:

[2016-11-20T14:39:25.475Z][002] PATH: /hello/world
[2016-11-20T14:39:25.475Z][002] CWD: /Users/harttle/src/shellhub/demo/
[2016-11-20T14:39:25.475Z][002] CMD: bash hello-world.sh
[2016-11-20T14:39:25.495Z][002]
[2016-11-20T14:39:25.495Z][002] STDOUT:
[2016-11-20T14:39:25.495Z][002] Hello, World!
[2016-11-20T14:39:25.495Z][002] Hi, Hell!

How to run this in background?

It's recommended to introduce a process manager like pm2.