Event emitter for Warframe worldstate & other events - TypeScript support included
npm install worldstate-emitterSuuuper simple emitter for worldstate events.
Very opinionated decisions on what events and event names, as well as.... everything else





``bash`
npm install worldstate-emitter
This package requires Node.js 20.10.0 or higher and is an ES Module.
You'll also need to install the following peer dependencies:
`bash`
npm install warframe-worldstate-parser@^5 warframe-worldstate-data@^3
For better logging support:
`bash`
npm install winston@^3
`typescript
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);
`
This package is written in TypeScript and includes full type definitions. All types are automatically available when using TypeScript:
`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");
`
`typescript
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
});
`
Configure the emitter with environment variables:
- LOG_LEVEL - Logging level (default: error)WORLDSTATE_URL
- - Custom worldstate API URLKUVA_URL
- - Custom Kuva/Arbitration data URLSENTIENT_URL
- - Custom Sentient Anomaly data URLWORLDSTATE_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 enableTWITTER_KEY
- - Twitter API consumer keyTWITTER_SECRET
- - Twitter API consumer secretTWITTER_BEARER_TOKEN
- - Twitter API bearer tokenTWITTER_TIMEOUT
- - Twitter update interval in ms (default: 60000)
| Emitter Event | Emit key | Description |
| :---------------- | ------------------ | ------------------------------------------- |
| RSS | rss | New forum post from DE |ws:update:raw
| Raw Worldstate | | Raw worldstate data updated |ws:update:parsed
| Parsed Worldstate | | Parsed worldstate data available |ws:update:event
| Worldstate Event | | Individual worldstate event |tweet
| Tweet | | New tweet from one of the selected accounts |
| Method | Parameters | Returns | Description |
| :---------------- | :------------------ | :------------------------ | :---------------------------- |
| getRss() | - | RssFeedItem[] | Get current RSS feed items |getWorldstate()
| | language?: string | WorldState \| undefined | Get worldstate for a language |getTwitter()
| | - | Promise | Get Twitter data |debug
| | - | DebugInfo | Get debug information |
Parameters:
- language - Defaults to en. Any locale from warframe-worldstate-data
Twitter Accounts
- Warframe (warframe)
- Digital Extremes (digitalextremes)
- [[DE]Pablo](https://twitter.com/PabloPoon) (pablo)
- Cameron Rogers (cameron)
- [[DE]Rebecca](https://twitter.com/rebbford) (rebecca)
- [[DE]Steve](https://twitter.com/sj_sinclair) (steve)
- [[DE]Danielle](https://twitter.com/soelloo) (danielle)
- [[DE]Megan](https://twitter.com/moitoi) (megan)
- [[DE]George](https://twitter.com/GameSoundDesign) (george)
- [[DE]Maciej](https://twitter.com/msinilo) (maciej)
- [[DE]Sheldon](https://twitter.com/sheldoncarter) (sheldon)
- [[DE]Marcus](https://twitter.com/narcbag) (narc)
- [[DE]Helen](https://twitter.com/helen_heikkila) (helen)
- Tobiah (me) (tobiah)
- WF Discord (wfdiscord)
Twitter Events
- tweetretweet
- reply
- quote
-
RSS Feeds
- Players helping Players
- PC Updates
- PC Announcements
- PS4 Updates
- PS4 Announcements
- XB1 Updates
- XB1 Announcements
- Switch Updates
- Switch Announcements
- News
- Developers Workshop
Staff Replies
- [[DE]Rebecca](https://forums.warframe.com/discover/839)
- [[DE]Danielle](https://forums.warframe.com/discover/840)
- [[DE]Drew](https://forums.warframe.com/discover/841)
- [[DE]Glen](https://forums.warframe.com/discover/842)
- [[DE]Taylor](https://forums.warframe.com/discover/1171)
- [[DE]Steve](https://forums.warframe.com/discover/1777)
- [[DE]Helen](https://forums.warframe.com/discover/1291)
- [[DE]Saske](https://forums.warframe.com/discover/1294)
- [[DE]Kaz](https://forums.warframe.com/discover/1295)
- [[DE]Pablo](https://forums.warframe.com/discover/1299)
- [[DE]Connor](https://forums.warframe.com/discover/1778)
- [[DE]Marcus](https://forums.warframe.com/discover/1779)
- [[DE]George](https://forums.warframe.com/discover/1780)
- [[DE]Bear](https://forums.warframe.com/discover/1781)
This project is written in TypeScript and uses tsdown for building:
`bash`
npm run build
This generates:
- dist/index.mjs - Compiled JavaScript moduledist/index.d.mts
- - TypeScript type definitions
`bash`
npm test
Tests use Mocha with tsx for TypeScript support.
This project uses Biome for linting and formatting:
`bash`
npm run lint # Check for issues
npm run lint:fix # Auto-fix issues
Generate TypeDoc documentation:
`bash`
npm run build:docs
`haskell`
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)
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 codenpm test
2. Run to ensure tests passnpm run build` to verify the build
3. Run
4. Use conventional commit messages
Apache-2.0
