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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@ai-workflow-pack/adapters

v1.0.1

Published

Infrastructure adapters (database, cache, queue, storage) for AI Workflow services

Downloads

206

Readme

@ai-workflow-pack/adapters

Infrastructure adapters providing unified interfaces for databases, caching, queues, and storage across AI Workflow microservices.

Installation

npm install @ai-workflow-pack/adapters

Features

  • 🗄️ Database Adapters: TypeORM, Sequelize, MongoDB
  • Cache Adapters: Redis, Memcached, In-Memory
  • 📬 Queue Adapters: RabbitMQ, Kafka, AWS SQS, NATS
  • 💾 Storage Adapters: AWS S3, Azure Blob, Local File System

Usage

Database Adapter

import { TypeORMAdapter, DatabaseConfig } from '@ai-workflow-pack/adapters';

const dbAdapter = new TypeORMAdapter({
  type: 'postgres',
  host: 'localhost',
  port: 5432,
  database: 'mydb',
  username: 'user',
  password: 'pass',
});

await dbAdapter.connect();
const results = await dbAdapter.query('SELECT * FROM users');
await dbAdapter.disconnect();

Cache Adapter

import { RedisAdapter } from '@ai-workflow-pack/adapters';

const cacheAdapter = new RedisAdapter({
  host: 'localhost',
  port: 6379,
});

await cacheAdapter.set('key', 'value', 3600); // TTL in seconds
const value = await cacheAdapter.get('key');
await cacheAdapter.delete('key');

Queue Adapter

RabbitMQ

import { RabbitMQAdapter } from '@ai-workflow-pack/adapters';

const queueAdapter = new RabbitMQAdapter({
  url: 'amqp://localhost:5672',
});

await queueAdapter.connect();
await queueAdapter.publish('my-queue', { data: 'message' });

await queueAdapter.subscribe('my-queue', async (message) => {
  console.log('Received:', message);
});

NATS (Real-time Communication)

import { NatsAdapter } from '@ai-workflow-pack/adapters';

const natsAdapter = new NatsAdapter({
  servers: 'nats://localhost:4222',
});

await natsAdapter.connect();

// Pub/Sub
await natsAdapter.publish('workflow.event', { workflowId: 123 });
await natsAdapter.subscribe('workflow.event', async (message) => {
  console.log('Received:', message.data);
});

// Request-Reply
await natsAdapter.reply('workflow.status', async (data) => {
  return { status: 'active' };
});
const response = await natsAdapter.request('workflow.status', { workflowId: 123 });

See NATS_QUICK_START.md for more details.

Storage Adapter

import { S3Adapter } from '@ai-workflow-pack/adapters';

const storageAdapter = new S3Adapter({
  accessKeyId: 'key',
  secretAccessKey: 'secret',
  region: 'us-east-1',
  bucket: 'my-bucket',
});

await storageAdapter.upload('file.txt', buffer);
const file = await storageAdapter.download('file.txt');
await storageAdapter.delete('file.txt');

Switching Implementations

All adapters implement common interfaces, making it easy to switch implementations:

// Development: Use in-memory cache
const cache = new InMemoryCacheAdapter();

// Production: Use Redis
const cache = new RedisAdapter({ host: 'redis', port: 6379 });

// Same interface for both!
await cache.set('key', 'value');
const value = await cache.get('key');

License

MIT