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

autobase-flow

v2.0.0

Published

Autobase-Flow is a lightweight library that integrates Autobase with Dagify-hyper reactive nodes. It simplifies building peer-to-peer hyper ecosystem tools by providing a single function, createAutobaseFlow, which initializes an Autobase instance, connect

Readme

Autobase-Flow

Autobase-Flow is a lightweight library that integrates Autobase with Dagify-hyper reactive nodes. It provides a single function, createAutobaseFlow, to set up a reactive integration for Autobase. This makes it easy to build peer-to-peer hyper ecosystem tools with a reactive data flow architecture.


Features

  • Reactive Integration: Leverages Dagify-hyper to create reactive nodes that manage Autobase views and updates.
  • Simplified Setup: A single function to initialize an Autobase instance with the necessary reactive integrations.
  • Flexible Configuration: Supports custom encoding options, key validation, and additional Autobase configuration.

Installation

Install the package via npm:

npm install autobase-flow

Make sure you also have the required peer dependencies installed (e.g., autobase, hypercore, and dagify-hyper).


Usage

Below is a simple example of how to use createAutobaseFlow to initialize an Autobase integration.

import { createAutobaseFlow } from 'autobase-flow';
import Corestore from 'corestore';
import RAM from 'random-access-memory';

// Function that returns a Corestore instance
const getCorestore = () => new Corestore(RAM.reusable());

// Create the AutobaseFlow integration with custom options.
const { autobase, viewLatestNode, applyNode } = createAutobaseFlow({
  getCorestore,
  view: "my-view",
  baseEncoding: "json",
  viewEncoding: "json"
});

// Use the autobase instance as usual.
await autobase.append("hello");

// Since viewLatestNode is reactive, it will update when the view changes.
console.log("Latest view:", viewLatestNode.value);

In this example, createAutobaseFlow:

  • Validates and decodes an optional key.
  • Retrieves a Corestore instance via the provided getCorestore function.
  • Configures the Autobase integration using Dagify-hyper's reactive nodes.
  • Returns the Autobase instance (aliased as autobase and base) along with the reactive nodes (viewLatestNode and applyNode).

API Documentation

createAutobaseFlow

/**
 * Creates an AutobaseFlow instance that integrates Autobase with dagify-hyper.
 *
 * This function initializes an Autobase instance using a Corestore provided by the `getCorestore`
 * function, and sets up the reactive integration via dagify-hyper. It validates and decodes the
 * optional key (which can be a Buffer or a Z32-encoded string), and configures the integration using
 * the provided view name and encoding options.
 *
 * @param {Object} options - Configuration options for creating an AutobaseFlow.
 * @param {function} options.getCorestore - A function that returns a Corestore instance.
 * @param {Buffer|string} [options.key] - An optional key as a Buffer or a Z32-encoded string.
 * @param {string} [options.view="view"] - The name of the view in the store.
 * @param {string} [options.baseEncoding="json"] - The encoding to use for the base hypercore.
 * @param {string} [options.viewEncoding=baseEncoding] - The encoding to use for the view hypercore.
 * @param {...*} [options.restConfig] - Additional configuration options to pass to Autobase.
 *
 * @throws {Error} If `getCorestore` is not a function.
 * @throws {Error} If a key is provided and it is neither a Buffer nor a Z32-encoded string.
 *
 * @returns {Object} An object containing:
 *   - **autobase**: The created Autobase instance.
 *   - **base**: Alias for the Autobase instance.
 *   - **config**: The integration configuration object from dagify-hyper.
 *   - **viewNode**: A reactive node that holds the current view.
 *   - **viewLatestNode**: A reactive node derived from the view node that tracks the latest view.
 *   - **applyNode**: A reactive node that captures updates, view, and hostcalls.
 */
const createAutobaseFlow = ({
  getCorestore,
  key,
  view = "view",
  baseEncoding = "json",
  viewEncoding = baseEncoding,
  ...restConfig
}) => {
  // ... implementation as shown in the source code ...
};

Contributing

Contributions are welcome! If you have suggestions, bug reports, or pull requests, please follow the guidelines in our CONTRIBUTING.md.


License

MIT