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

burpl

v2.1.0

Published

Control your daemons with tab-completable repls

Downloads

18

Readme

Bogus Underground Read-Print-Loop

(A REPL library with some better ergonomics)

As a long time user of Cisco network products and routing daemons such as Quagga (nee Zebra), I've come to enjoy their sort of CLI. The tab completion is really good for exploring what the system can do. Either that or I have Stockholm syndrome setting in and it's actually terrible. I'm never sure when it comes to old command line technologies. I do use plain vi and mksh. So take it with a grain of salt.

The long and short of it is that the command language looks something like this:

show ip routes
show ipv6 routes
show status
enable

and if you press the tab key at a prompt, it'll helpfully spit out what you can do from there for each word, and it also lets you abbreviate if you're not ambiguous.

sh ip r

That's actually a legit alias for show ip routes given that list of available commands.

This package is a client and server for these interactions. There's a generic burpl command, modelled after Quagga's vtysh, and a server component that lets you supply an object of "command": async function pairs, and get back a server you just need to listen on an AF_UNIX socket.

Example

const burpl = require('burpl')
const { promisify } = require('util')
const listen = promisify(require('unix-listen'))

const users = [ "aphrodite", "eris", "persephone", "sappho"];

const server = burpl({
    "help": async () => "There is no help for you",
    "user list": () => users.join("\n"),
    "user add USER": (user) => {
		return `added user '${user}' (I lie)`;
	},
    "user add USER really": async (user) => {
		await Promise.resolve(user).then(user => users.push(user));
		return `added user '${user}' for real`;
	},
})

listen(server, 'test.sock')

You can communicate with this server using burpl -s test.sock.

A screen capture of burpl in use