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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@arabesque/core

v1.0.0-beta.1

Published

A nano-framework to build applications

Readme

Arabesque Core

NPM version Coverage Status

A nano-framework to build applications

Getting started

Arabesque Core provides a minimal foundation to create applications, consisting of three types and a function.

Listener

type Listener<Channel, Context> = (channel: Channel, handler: (context: Context) => Promise<Context>) => Promise<() => Promise<void>>;

The fundamental part of an Arabesque application, the Listener is passed by the application a channel, that the Listener is expected to subscribe to, and a handler, that the Listener must call whenever it receives something from the channel. The Listener must return a promise that resolves to an argument-less function that, when executed, stop the Listener.

A channel can take any imaginable form, for example:

  • a number in the context of a TCP service, representing a port
  • a structured object in the context of a Kafka consumer, representing a broker, a group ID and a topic
  • a string in the context of a file watcher, representing a pattern of files to watch

Middleware

type Middleware<Signal> = (context: Signal, next: (context: Signal) => Promise<Signal>) => Promise<Signal>;

The operational part of an Arabesque application, the Middleware is passed by the application a context, coming from either the Listener or a previous Middleware, and a next function, that the Middleware may call to pass the context forward.

Application

type Application<Channel> = (channel: Channel) => Promise<() => Promise<void>>;

The Arabesque Application itself that, when executed, returns a Promise that resolves to an argument-less function that, when executed, stop the Application.

createApplication

import type {Middleware} from "./index";

declare const createApplication: <Channel, Context>(
    listen: Listener<Channel, Context>,
    middleware: Middleware<Context>
) => Application<Channel, Context>;

The factory that creates an Arabesque Application from a Listener and a Middleware.

Code sample

import type {Listener} from "@arabesque/core";
import {createApplication} from "@arabesque/core";

const listener: Listener<string, string> = (channel, handler) => {
    return handler(channel).then(() => {
        return () => Promise.resolve();
    });
};

const start = createApplication(listener, (context, next) => {
    console.log(`I am the middleware and I received ${context}`);

    return next(context);
});

return start('foo').then((stop) => {
    return stop();
});