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

servep

v2.0.8

Published

serve stdio scripts as stateful http, jsonp, ws, and tcp

Downloads

46

Readme

This script serves stdio executables over TCP, HTTP, or WebSockets.
[Bug fixes and features requests: https://github.com/vdv7/servep/issues]

Each new TCP or WS connection to server will spawn a new process, and pipe
socket-out to std-in, and std-out to socket-in.

HTTP requests without a session-id are redirected, so as to include unique
session-id. Each new session-id is tied to a newly spawned process. Data in
each HTTP request with a session-id is routed to its respective process 
std-in, and the HTTP response is generated from that process' std-out.

  HTTP requests adhere to the CDE (callback/data/end) protocol, i.e.:

    JSONP requests are enabled by adding GET parameter "callback" or GET
      parameter "c"
    all input to server-side process is passed in POST method body, or
      as the value for GET parameter "data" or GET parameter "d"
    adding GET parameter "end" or GET parameter "e" to an HTTP request
      gracefully ends the current session

    example of simple echo process interaction:

      client GET request:
        http://localhost:8000/myapp
      server responds with a status code of 302 and the following body:
        http://localhost:8000/myapp:xxx
          (where xxx is the session id)
      client GET request:
        http://localhost:8000/myapp:xxx?d=hello
      server response body:
        foo("you said: hello")
      client GET request: http://localhost:8000/myapp:xxx?e
      server closes the running echo process and responds with status 204


Examples:
  servep -p 8000 --http "hi::echo hi" --ws "hi::echo hi" --tcp "8001::echo hi"
  (will serve process "echo hi" at http://localhost:8000/hi, 
    ws://localhost:8000/hi, and on tcp without any headers on port 8001)

  servep -p 8000 --http samples/_http/ --py python3
  (will serve all executables from samples/_http folder, as well as any
    python3 scripts that have a .py extension. if samples/_http includes
    helloecho.py, it will be served at http://localhost:8000/helloecho.py)



Using this script requires that you have node.js installed
  (see https://nodejs.org)

Try out the service on the sample scripts folder:
  node servep.js samples/

Install script via npm: npm install -g servep
  (you may need to precede the previous line with "sudo" on linux)

Run after npm installation:
  servep [Options]

Get usage:
  servep

Get more detailed help:
  servep --help