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

@jsm-mit/rabbit-motoko-package

v0.6.4

Published

Wrapper TypeScript package for Rabbit Motoko Canister.

Readme

Rabbit Motoko Package

A TypeScript library for interacting with the Rabbit Motoko actor on the Internet Computer (IC) platform. Simplifies interaction with the Rabbit task queuing system through a convenient wrapper around @dfinity/agent.

Installation

npm install @jsm-mit/rabbit-motoko-package

Usage

Initialization

import { RabbitMotokoActor } from '@jsm-mit/rabbit-motoko-package';

const canisterId = 'your-canister-id';
const rabbitActor = new RabbitMotokoActor(canisterId);

Adding a task

const taskId = await rabbitActor.addTask({
  channel: 'my-channel',
  taskType: 'process-data',
  payload: 'task payload data'
});
console.log('Task added with ID:', taskId);

Getting available tasks

const availableTaskIds = await rabbitActor.getAvailableTaskIds('my-channel');
console.log('Available tasks:', availableTaskIds);

Claiming a task

const task = await rabbitActor.claimTask({
  taskId: 123n,
  workerId: 'worker-1'
});

if (task.length > 0) {
  console.log('Task claimed:', task[0]);
} else {
  console.log('Task not available');
}

Completing a task

const success = await rabbitActor.completeTask({
  taskId: 123n,
  result: 'task completed successfully'
});

if (success) {
  console.log('Task completed successfully');
}

Getting all tasks

const allTasks = await rabbitActor.getTasks();
console.log('All tasks:', allTasks);

Agent synchronization

In case of time/certificate issues:

await rabbitActor.sync();

API

RabbitMotokoActor Class

Constructor

  • new RabbitMotokoActor(canisterId: string) - Creates a new instance with the provided canister ID

Public Methods

  • sync(): Promise<void> - Synchronizes the agent time with the IC network
  • addTask(args: AddTaskArgs): Promise<bigint> - Adds a new task to the queue
  • claimTask(args: ClaimTaskArgs): Promise<[] | [Task]> - Claims a task for a worker
  • completeTask(args: CompleteTaskArgs): Promise<boolean> - Completes a claimed task
  • getAvailableTaskIds(channel: string): Promise<bigint[]> - Gets IDs of available tasks in a channel
  • getTasks(): Promise<Task[]> - Gets a list of all tasks

Types

The library uses types generated from the Rabbit Motoko canister:

  • AddTaskArgs - Arguments for adding a task
  • ClaimTaskArgs - Arguments for claiming a task
  • CompleteTaskArgs - Arguments for completing a task
  • Task - Task structure

Requirements

  • Node.js 16+
  • TypeScript 4.5+

License

ISC

Author

@jsm-mit