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

worldstate-emitter

v2.4.4

Published

Event emitter for Warframe worldstate & other events - TypeScript support included

Readme

Worldstate Emitter

Suuuper simple emitter for worldstate events.

Very opinionated decisions on what events and event names, as well as.... everything else

semantic-release: angular npm npm downloads TypeScript Discord

Installation

npm install worldstate-emitter

This package requires Node.js 20.10.0 or higher and is an ES Module.

Peer Dependencies

You'll also need to install the following peer dependencies:

npm install warframe-worldstate-parser@^5 warframe-worldstate-data@^3

Optional Dependencies

For better logging support:

npm install winston@^3

Usage

Basic Example

import WorldstateEmitter from "worldstate-emitter";

// Create emitter instance
const emitter = await WorldstateEmitter.make({
  locale: "en",
  features: ["worldstate", "rss", "twitter"],
});

// Listen for worldstate events
emitter.on("ws:update:event", (event) => {
  console.log("New worldstate event:", event.id);
});

// Listen for RSS posts
emitter.on("rss", (post) => {
  console.log("New forum post:", post.title);
});

// Listen for tweets
emitter.on("tweet", (tweet) => {
  console.log("New tweet:", tweet.text);
});

// Get current worldstate
const worldstate = emitter.getWorldstate("en");
console.log("Current worldstate:", worldstate);

TypeScript Support

This package is written in TypeScript and includes full type definitions. All types are automatically available when using TypeScript:

import WorldstateEmitter from "worldstate-emitter";
import type WorldState from "warframe-worldstate-parser";

const emitter = await WorldstateEmitter.make({ locale: "en" });

// TypeScript will infer the correct types
const ws: WorldState | undefined = emitter.getWorldstate("en");

Configuration Options

interface WorldstateEmitterOptions {
  locale?: string; // Language to filter events (e.g., 'en', 'es', 'de')
  features?: string[]; // Features to enable: 'worldstate', 'rss', 'twitter'
}

const emitter = await WorldstateEmitter.make({
  locale: "en", // Optional: filter to English only
  features: ["worldstate", "rss"], // Optional: only enable these features
});

Environment Variables

Configure the emitter with environment variables:

  • LOG_LEVEL - Logging level (default: error)
  • WORLDSTATE_URL - Custom worldstate API URL
  • KUVA_URL - Custom Kuva/Arbitration data URL
  • SENTIENT_URL - Custom Sentient Anomaly data URL
  • WORLDSTATE_CRON - Cron pattern for worldstate updates (default: 25 */5 * * * *)
  • WS_EXTERNAL_CRON - Cron pattern for external data (default: 0 */10 * * * *)
  • WS_EMITTER_FEATURES - Comma-separated list of features to enable
  • TWITTER_KEY - Twitter API consumer key
  • TWITTER_SECRET - Twitter API consumer secret
  • TWITTER_BEARER_TOKEN - Twitter API bearer token
  • TWITTER_TIMEOUT - Twitter update interval in ms (default: 60000)

Emitter Events

Main Events

| Emitter Event | Emit key | Description | | :---------------- | ------------------ | ------------------------------------------- | | RSS | rss | New forum post from DE | | Raw Worldstate | ws:update:raw | Raw worldstate data updated | | Parsed Worldstate | ws:update:parsed | Parsed worldstate data available | | Worldstate Event | ws:update:event | Individual worldstate event | | Tweet | tweet | New tweet from one of the selected accounts |

API Methods

| Method | Parameters | Returns | Description | | :---------------- | :------------------ | :------------------------ | :---------------------------- | | getRss() | - | RssFeedItem[] | Get current RSS feed items | | getWorldstate() | language?: string | WorldState \| undefined | Get worldstate for a language | | getTwitter() | - | Promise<any> | Get Twitter data | | debug | - | DebugInfo | Get debug information |

Parameters:

  • tweet
  • retweet
  • reply
  • quote

Development

Building

This project is written in TypeScript and uses tsdown for building:

npm run build

This generates:

  • dist/index.mjs - Compiled JavaScript module
  • dist/index.d.mts - TypeScript type definitions

Testing

npm test

Tests use Mocha with tsx for TypeScript support.

Linting

This project uses Biome for linting and formatting:

npm run lint          # Check for issues
npm run lint:fix      # Auto-fix issues

Documentation

Generate TypeDoc documentation:

npm run build:docs

Project Structure

worldstate-emitter/
├── handlers/          # Event handlers
│   ├── events/       # Event processors
│   ├── RSS.ts        # RSS feed handler
│   ├── Twitter.ts    # Twitter API handler
│   └── Worldstate.ts # Worldstate handler
├── utilities/        # Utility classes and functions
│   ├── Cache.ts      # Cron-based cache
│   ├── WSCache.ts    # Worldstate cache wrapper
│   ├── env.ts        # Environment configuration
│   └── index.ts      # Shared utilities
├── resources/        # Configuration files
│   ├── config.ts     # URL and cron patterns
│   ├── rssFeeds.json # RSS feed definitions
│   └── tweeters.json # Twitter accounts to watch
├── types/            # TypeScript type definitions
├── test/             # Test files
└── dist/             # Build output (generated)

Contributing

This project uses:

  • TypeScript with strict mode
  • Biome for linting and formatting
  • Conventional Commits for commit messages
  • Semantic Release for automated versioning

Before submitting a PR:

  1. Run npm run lint:fix to format code
  2. Run npm test to ensure tests pass
  3. Run npm run build to verify the build
  4. Use conventional commit messages

License

Apache-2.0

Help & Contact

Discord