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

@famcache/famcache

v2.0.0

Published

![NPM Downloads](https://img.shields.io/npm/dw/%40famcache%2Ffamcache) ![NPM Version](https://img.shields.io/npm/v/%40famcache%2Ffamcache) ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/famcache/node-famcache/lint_

Readme

Node-famcache

NPM Downloads NPM Version GitHub Actions Workflow Status TypeScript Badge

Node-famcache is a Node.js client for Famcache, a caching server written in Go. This client allows you to interact with the Famcache server from your Node.js applications, providing an easy-to-use interface for caching operations.

Table of Contents

Installation

To install Node-famcache, use npm:

npm install @famcache/famcache

Usage

Connecting to the Server

First, import the module and create a client instance:

import Famcache from '@famcache/famcache';

const client = new FamcacheClient({
  host: 'localhost',
  port: 3577,
});

Basic Operations

Set a Value

To store a value in the cache:

await client.set('key', 'value', 30000);

Get a Value

To retrieve a value from the cache:

const value = await client.get('key');

Delete a Value

To delete a value from the cache:

await client.del('key');

Publish a topic

To publish data to the topic:

client.messaging.publish('topic', 'data');

Subscribe to the topic

To subscribe to the topic:

client.messaging.subscribe('topic', (data) => {
  // ...
});

Unsubscribe from the topic

To unsubscribe from the topic:

client.messaging.unsubscribe('topic');

API Reference

FamcacheClient

new FamcacheClient(options)

Creates a new client instance.

  • options (object):
    • host (string): The host of the Famcache server.
    • port (number): The port of the Famcache server.

client.set(key, value, ttl?)

Sets a value in the cache.

  • key (string): The key under which the value will be stored.
  • value (string): The value to store.
  • ttl (number): Time to leave (optional)

client.get(key)

Gets a value from the cache.

  • key (string): The key of the value to retrieve.

client.delete(key, callback)

Deletes a value from the cache.

client.messaging.publish(topic, data)

Publishes data to the topic

  • topic (string): Topic name
  • data (string): Payload that will be send to the subscribers

client.messaging.subscribe(topic, callback)

Subscribes to the topic

  • topic (string): Topic name
  • callback (Function): Callback function that will be invoked when message will be received for this topic

client.messaging.unsubscribe(topic)

Unsubscribes from the topic

  • topic (string): Topic name

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

License

Node-famcache is licensed under the MIT License. See the LICENSE file for more details.