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

anmo

v1.0.0

Published

Official Node.js SDK for Anmo Feature Flags

Readme

Anmo SDK

Official Node.js SDK for Anmo Feature Flags - a modern, real-time feature flag management service.

Installation

npm install anmo

Quick Start

import { AnmoClient } from "anmo";

const client = new AnmoClient({
  apiKey: "anmo_your_api_key_here",
  autoFetch: true, // Automatically fetch flags on init
  autoStream: true, // Automatically start streaming updates
});

// Wait for initial flags to load
await client.ready();

// Check if a flag is enabled
if (client.isEnabled("new-dashboard")) {
  console.log("New dashboard is enabled!");
}

Features

  • 🚀 Real-time Updates - Automatically sync flag changes via Server-Sent Events
  • 🔒 Type-safe - Full TypeScript support with type definitions
  • 📦 Lightweight - Minimal dependencies
  • 🎯 Simple API - Easy to use, hard to misuse
  • Fast - Built for performance
  • ⚛️ React Hooks - First-class React support with custom hooks

Installation

npm install anmo

For React applications, React 16.8+ is required (for hooks support).

Usage

Basic Example

import { AnmoClient } from "anmo";

const client = new AnmoClient({
  apiKey: "anmo_your_api_key_here",
  baseUrl: "https://your-anmo-instance.com",
});

// Wait for initial flags to load
await client.ready();

// Check individual flag
if (client.isEnabled("new-dashboard")) {
  console.log("New dashboard is enabled!");
}

// Get a specific flag with a default value
const darkMode = client.getFlag("dark-mode", false);

// Get all flags
const allFlags = client.getAllFlags();
console.log("All flags:", allFlags);

Real-time Updates

const client = new AnmoClient({
  apiKey: "anmo_your_api_key_here",
  baseUrl: "https://your-anmo-instance.com",
  autoStream: true, // Start streaming immediately
});

// Listen for flag updates
client.onUpdate((flags) => {
  console.log("Flags updated:", flags);

  // React to changes
  if (flags["maintenance-mode"]) {
    showMaintenanceBanner();
  }
});

// Clean up when done
process.on("SIGINT", () => {
  client.destroy();
  process.exit();
});

Manual Streaming Control

const client = new AnmoClient({
  apiKey: "anmo_your_api_key_here",
  baseUrl: "https://your-anmo-instance.com",
  autoStream: false, // Don't auto-start
});

// Start streaming manually
client.startStream();

// Stop streaming when needed
client.stopStream();

React Usage

The SDK provides React hooks for easy integration:

Basic Hook

import { useFeatureFlag } from "anmo/react";

function App() {
  const showNewDashboard = useFeatureFlag("new-dashboard", {
    apiKey: process.env.REACT_APP_ANMO_API_KEY!,
  });
  const useDarkMode = useFeatureFlag("use-dark-mode", {
    apiKey: process.env.REACT_APP_ANMO_API_KEY!,
  });

  if (loading) return <div>Loading...</div>;
  if (error) return <div>Error: {error.message}</div>;

  return (
    <div>
      {showNewDashboard && <NewDashboard />}
      {useDarkMode && <DarkModeToggle />}
    </div>
  );
}

React API Reference

useFeatureFlag(flagKey, options, defaultValue?)

Hook for a single feature flag. Returns boolean indicating if the flag is enabled.

Node.js API Reference

Constructor Options

interface AnmoClientOptions {
  apiKey: string; // Required: Your Anmo API key
  baseUrl?: string; // Optional: Base URL (default: 'http://localhost:3000')
  autoFetch?: boolean; // Optional: Auto-fetch on init (default: true)
  autoStream?: boolean; // Optional: Auto-start streaming (default: false)
}

Methods

ready(): Promise<void>

Wait for the client to be ready (initial flags fetched).

getFlags(): Promise<FlagMap>

Manually fetch all feature flags. Usually not needed if autoFetch is enabled.

isEnabled(key: string, defaultValue?: boolean): boolean

Check if a feature flag is enabled. Returns defaultValue (default: false) if flag doesn't exist.

getFlag(key: string, defaultValue?: boolean): boolean

Alias for isEnabled().

getAllFlags(): FlagMap

Get a copy of all current flags as an object.

onUpdate(listener: (flags: FlagMap) => void): () => void

Subscribe to flag updates. Returns an unsubscribe function.

const unsubscribe = client.onUpdate((flags) => {
  console.log("Updated flags:", flags);
});

// Later, to unsubscribe:
unsubscribe();

startStream(): void

Start streaming real-time updates via Server-Sent Events.

stopStream(): void

Stop streaming updates and close the connection.

destroy(): void

Clean up all resources, close connections, and remove all listeners.

Publishing to npm

To publish this package to npm:

cd sdks/javascript
npm install
npm run build
npm publish --access public

Development

To work on the SDK locally:

cd sdks/javascript
npm install
npm run build
npm link

Then in your project:

npm link anmo

License

MIT