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

@rnet-ai/rnet-caller

v1.0.2

Published

Frontend library for the rNet Protocol — forwards requests through the local rNet Client so AI calls use the user's token, not the developer's.

Readme

@rnet-ai/rnet-caller

Official Website: rnetai.org GitHub: rNetAi

A browser-only JavaScript library for the rNet Protocol.

Connects a developer's frontend to a locally-installed rNet Client, which attaches an AI pass using the end user's token before forwarding requests to the developer's backend. Developers do not pay upfront AI token costs.

This library does not call any AI model directly. It only communicates with the local rNet Client over localhost.

Flow

Developer's FrontendLocal rNet ClientDeveloper's Backend

Installation

npm install @rnet-ai/rnet-caller

Quick Start

import rnetCaller from "@rnet-ai/rnet-caller";

// 1. Initialize to find the local rNet Client
await rnetCaller.init();

// 2. Send a request through the local client to the developer backend
const response = await rnetCaller.send({
  url: "https://<develoepr backend path>/please-dont-break",
  method: "POST",
  headers: {"Authorization:" , "Bearer eyJhbGciOiJ.....IUzVT7Ib5"}
  body: JSON.stringify({
    username: "rNet Ai",
    password: "KSKE9cC9MIR3QSq8OAk59FklDBM4Cg1K9MTfYYiP1wXjFczTbFTWYlz1ePAg2oCw",
    command: "delete everything",
  }),
});

if(!response.ok) {
  throw new Error(`from rNet Client error: ${response.status}`);
}

const data = await response.json();

console.log(data);

// 3. (Optional) Clear cache during development
await rnetCaller.clearCache();

API Reference

await rnetCaller.init()

Scans for the local rNet Client on localhost and checks its version. Alerts the user and redirects to the download page if the client is missing or outdated. Returns true if successful. Safe to call multiple times.

await rnetCaller.send(descriptor, options?)

Sends a request through the local rNet Client to the target backend. The client automatically attaches an AI pass before forwarding.

Important: Only use the send() function for endpoints where the backend requires an AI pass. For all other regular API calls, use standard fetch() directly.

Descriptor fields:

  • url (string, required): The target backend URL.
  • method (string, required): The HTTP method (e.g., POST).
  • headers (object, optional): Custom headers. Content-Type is always enforced as application/json.
  • query (object, optional): Query parameters.
  • body (string, optional): Request body (JSON string).

Options:

  • debug (boolean, optional): Set to true to log the payload to the console.

Returns: The parsed JSON response from the backend.

await rnetCaller.clearCache()

Clears the cached responses in the local rNet Client, including the URL mapping with the AI model. This is a developer utility to skip cache timeouts so any changes to the AI model take effect immediately during development.

Error Handling

Errors are thrown as RNetError instances with a code property.

import rnetCaller, { RNetError } from "@rnet-ai/rnet-caller";

try {
  const response = await rnetCaller.send({ url: "https://<developer backend>/api/v1/data", method: "GET" });

  if (!response.ok) {
    throw new Error(`From rNet Client error: ${response.status}`);
  }

  const data = await response.json();
  return data;
} catch (err) {
  if (err instanceof RNetError) {
    console.error(`Error code: ${err.code}`, err.message);
  }
}

License

MIT