{"id":18469122,"url":"https://github.com/wfcd/worldstate-emitter","last_synced_at":"2026-02-07T04:02:56.176Z","repository":{"id":35207238,"uuid":"216466274","full_name":"WFCD/worldstate-emitter","owner":"WFCD","description":"Super simple emitter for Warframe data","archived":false,"fork":false,"pushed_at":"2025-03-30T00:03:05.000Z","size":1729,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-04T05:45:47.902Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://wfcd.github.io/worldstate-emitter/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WFCD.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-21T03:02:32.000Z","updated_at":"2025-03-30T00:02:00.000Z","dependencies_parsed_at":"2024-01-18T17:13:21.203Z","dependency_job_id":"4828b1b5-b9db-4cd1-bf47-7e8da86c3657","html_url":"https://github.com/WFCD/worldstate-emitter","commit_stats":{"total_commits":277,"total_committers":8,"mean_commits":34.625,"dds":0.5956678700361011,"last_synced_commit":"3070cc21c3baddaac603a92c1bb391f56a9ddb37"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WFCD%2Fworldstate-emitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WFCD%2Fworldstate-emitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WFCD%2Fworldstate-emitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WFCD%2Fworldstate-emitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WFCD","download_url":"https://codeload.github.com/WFCD/worldstate-emitter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247824193,"owners_count":21002228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T10:09:01.136Z","updated_at":"2026-02-07T04:02:56.170Z","avatar_url":"https://github.com/WFCD.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Worldstate Emitter\n\nSuuuper simple emitter for worldstate events.\n\nVery opinionated decisions on what events and event names, as well as.... everything else\n\n[![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)\n[![npm](https://img.shields.io/npm/v/worldstate-emitter.svg)](https://www.npmjs.com/package/worldstate-emitter)\n[![npm downloads](https://img.shields.io/npm/dm/worldstate-emitter.svg)](https://www.npmjs.com/package/worldstate-emitter)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.9-blue.svg)](https://www.typescriptlang.org/)\n[![Discord](https://img.shields.io/discord/256087517353213954.svg?logo=discord)](https://discord.gg/jGZxH9f)\n\n## Installation\n\n```bash\nnpm install worldstate-emitter\n```\n\nThis package requires Node.js 20.10.0 or higher and is an ES Module.\n\n### Peer Dependencies\n\nYou'll also need to install the following peer dependencies:\n\n```bash\nnpm install warframe-worldstate-parser@^5 warframe-worldstate-data@^3\n```\n\n### Optional Dependencies\n\nFor better logging support:\n\n```bash\nnpm install winston@^3\n```\n\n## Usage\n\n### Basic Example\n\n```typescript\nimport WorldstateEmitter from \"worldstate-emitter\";\n\n// Create emitter instance\nconst emitter = await WorldstateEmitter.make({\n  locale: \"en\",\n  features: [\"worldstate\", \"rss\", \"twitter\"],\n});\n\n// Listen for worldstate events\nemitter.on(\"ws:update:event\", (event) =\u003e {\n  console.log(\"New worldstate event:\", event.id);\n});\n\n// Listen for RSS posts\nemitter.on(\"rss\", (post) =\u003e {\n  console.log(\"New forum post:\", post.title);\n});\n\n// Listen for tweets\nemitter.on(\"tweet\", (tweet) =\u003e {\n  console.log(\"New tweet:\", tweet.text);\n});\n\n// Get current worldstate\nconst worldstate = emitter.getWorldstate(\"en\");\nconsole.log(\"Current worldstate:\", worldstate);\n```\n\n### TypeScript Support\n\nThis package is written in TypeScript and includes full type definitions. All types are automatically available when using TypeScript:\n\n```typescript\nimport WorldstateEmitter from \"worldstate-emitter\";\nimport type WorldState from \"warframe-worldstate-parser\";\n\nconst emitter = await WorldstateEmitter.make({ locale: \"en\" });\n\n// TypeScript will infer the correct types\nconst ws: WorldState | undefined = emitter.getWorldstate(\"en\");\n```\n\n### Configuration Options\n\n```typescript\ninterface WorldstateEmitterOptions {\n  locale?: string; // Language to filter events (e.g., 'en', 'es', 'de')\n  features?: string[]; // Features to enable: 'worldstate', 'rss', 'twitter'\n}\n\nconst emitter = await WorldstateEmitter.make({\n  locale: \"en\", // Optional: filter to English only\n  features: [\"worldstate\", \"rss\"], // Optional: only enable these features\n});\n```\n\n### Environment Variables\n\nConfigure the emitter with environment variables:\n\n- `LOG_LEVEL` - Logging level (default: `error`)\n- `WORLDSTATE_URL` - Custom worldstate API URL\n- `KUVA_URL` - Custom Kuva/Arbitration data URL\n- `SENTIENT_URL` - Custom Sentient Anomaly data URL\n- `WORLDSTATE_CRON` - Cron pattern for worldstate updates (default: `25 */5 * * * *`)\n- `WS_EXTERNAL_CRON` - Cron pattern for external data (default: `0 */10 * * * *`)\n- `WS_EMITTER_FEATURES` - Comma-separated list of features to enable\n- `TWITTER_KEY` - Twitter API consumer key\n- `TWITTER_SECRET` - Twitter API consumer secret\n- `TWITTER_BEARER_TOKEN` - Twitter API bearer token\n- `TWITTER_TIMEOUT` - Twitter update interval in ms (default: `60000`)\n\n## Emitter Events\n\n### Main Events\n\n| Emitter Event     | Emit key           | Description                                 |\n| :---------------- | ------------------ | ------------------------------------------- |\n| RSS               | `rss`              | New forum post from DE                      |\n| Raw Worldstate    | `ws:update:raw`    | Raw worldstate data updated                 |\n| Parsed Worldstate | `ws:update:parsed` | Parsed worldstate data available            |\n| Worldstate Event  | `ws:update:event`  | Individual worldstate event                 |\n| Tweet             | `tweet`            | New tweet from one of the selected accounts |\n\n### API Methods\n\n| Method            | Parameters          | Returns                   | Description                   |\n| :---------------- | :------------------ | :------------------------ | :---------------------------- |\n| `getRss()`        | -                   | `RssFeedItem[]`           | Get current RSS feed items    |\n| `getWorldstate()` | `language?: string` | `WorldState \\| undefined` | Get worldstate for a language |\n| `getTwitter()`    | -                   | `Promise\u003cany\u003e`            | Get Twitter data              |\n| `debug`           | -                   | `DebugInfo`               | Get debug information         |\n\n**Parameters:**\n\n- `language` - Defaults to `en`. Any locale from [`warframe-worldstate-data`](https://github.com/WFCD/warframe-worldstate-data)\n\n\u003cdetails\u003e\n  \u003csummary\u003eTwitter Accounts\u003c/summary\u003e\n\n- [Warframe](https://twitter.com/playwarframe) (warframe)\n- [Digital Extremes](https://twitter.com/digitalextremes) (digitalextremes)\n- [[DE]Pablo](https://twitter.com/PabloPoon) (pablo)\n- [Cameron Rogers](https://twitter.com/cam_rogers) (cameron)\n- [[DE]Rebecca](https://twitter.com/rebbford) (rebecca)\n- [[DE]Steve](https://twitter.com/sj_sinclair) (steve)\n- [[DE]Danielle](https://twitter.com/soelloo) (danielle)\n- [[DE]Megan](https://twitter.com/moitoi) (megan)\n- [[DE]George](https://twitter.com/GameSoundDesign) (george)\n- [[DE]Maciej](https://twitter.com/msinilo) (maciej)\n- [[DE]Sheldon](https://twitter.com/sheldoncarter) (sheldon)\n- [[DE]Marcus](https://twitter.com/narcbag) (narc)\n- [[DE]Helen](https://twitter.com/helen_heikkila) (helen)\n- [Tobiah (me)](https://twitter.com/tobitenno) (tobiah)\n- [WF Discord](https://twitter.com/wfdiscord) (wfdiscord)\n\u003c/details\u003e\n\n\u003cbr /\u003e\n\u003cdetails\u003e \u003csummary\u003eTwitter Events\u003c/summary\u003e\n\n- `tweet`\n- `retweet`\n- `reply`\n- `quote`\n\u003c/details\u003e\n\n\u003cbr /\u003e\n\u003cdetails\u003e\u003csummary\u003eRSS Feeds\u003c/summary\u003e\n\n- [Players helping Players](https://forums.warframe.com/forum/38-players-helping-players)\n- [PC Updates](https://forums.warframe.com/forum/3-pc-update-notes)\n- [PC Announcements](https://forums.warframe.com/forum/2-pc-announcements)\n- [PS4 Updates](https://forums.warframe.com/forum/152-ps4-update-notes)\n- [PS4 Announcements](https://forums.warframe.com/forum/151-ps4-announcements)\n- [XB1 Updates](https://forums.warframe.com/forum/253-xbox-one-update-notes)\n- [XB1 Announcements](https://forums.warframe.com/forum/252-xbox-one-announcements)\n- [Switch Updates](https://forums.warframe.com/forum/1196-nintendo-switch-update-notes)\n- [Switch Announcements](https://forums.warframe.com/forum/1198-nintendo-switch-announcements)\n- [News](https://forums.warframe.com/forum/170-announcements-events)\n- [Developers Workshop](https://forums.warframe.com/forum/123-developer-workshop-update-notes)\n\n \u003cdetails\u003e\u003csummary\u003eStaff Replies\u003c/summary\u003e\n\n- [[DE]Rebecca](https://forums.warframe.com/discover/839)\n- [[DE]Danielle](https://forums.warframe.com/discover/840)\n- [[DE]Drew](https://forums.warframe.com/discover/841)\n- [[DE]Glen](https://forums.warframe.com/discover/842)\n- [[DE]Taylor](https://forums.warframe.com/discover/1171)\n- [[DE]Steve](https://forums.warframe.com/discover/1777)\n- [[DE]Helen](https://forums.warframe.com/discover/1291)\n- [[DE]Saske](https://forums.warframe.com/discover/1294)\n- [[DE]Kaz](https://forums.warframe.com/discover/1295)\n- [[DE]Pablo](https://forums.warframe.com/discover/1299)\n- [[DE]Connor](https://forums.warframe.com/discover/1778)\n- [[DE]Marcus](https://forums.warframe.com/discover/1779)\n- [[DE]George](https://forums.warframe.com/discover/1780)\n- [[DE]Bear](https://forums.warframe.com/discover/1781)\n  \u003c/details\u003e\n\u003c/details\u003e\n\n\u003cbr /\u003e\n\n## Development\n\n### Building\n\nThis project is written in TypeScript and uses `tsdown` for building:\n\n```bash\nnpm run build\n```\n\nThis generates:\n\n- `dist/index.mjs` - Compiled JavaScript module\n- `dist/index.d.mts` - TypeScript type definitions\n\n### Testing\n\n```bash\nnpm test\n```\n\nTests use Mocha with `tsx` for TypeScript support.\n\n### Linting\n\nThis project uses Biome for linting and formatting:\n\n```bash\nnpm run lint          # Check for issues\nnpm run lint:fix      # Auto-fix issues\n```\n\n### Documentation\n\nGenerate TypeDoc documentation:\n\n```bash\nnpm run build:docs\n```\n\n## Project Structure\n\n```haskell\nworldstate-emitter/\n├── handlers/          # Event handlers\n│   ├── events/       # Event processors\n│   ├── RSS.ts        # RSS feed handler\n│   ├── Twitter.ts    # Twitter API handler\n│   └── Worldstate.ts # Worldstate handler\n├── utilities/        # Utility classes and functions\n│   ├── Cache.ts      # Cron-based cache\n│   ├── WSCache.ts    # Worldstate cache wrapper\n│   ├── env.ts        # Environment configuration\n│   └── index.ts      # Shared utilities\n├── resources/        # Configuration files\n│   ├── config.ts     # URL and cron patterns\n│   ├── rssFeeds.json # RSS feed definitions\n│   └── tweeters.json # Twitter accounts to watch\n├── types/            # TypeScript type definitions\n├── test/             # Test files\n└── dist/             # Build output (generated)\n```\n\n## Contributing\n\nThis project uses:\n\n- **TypeScript** with strict mode\n- **Biome** for linting and formatting\n- **Conventional Commits** for commit messages\n- **Semantic Release** for automated versioning\n\nBefore submitting a PR:\n\n1. Run `npm run lint:fix` to format code\n2. Run `npm test` to ensure tests pass\n3. Run `npm run build` to verify the build\n4. Use conventional commit messages\n\n## License\n\nApache-2.0\n\n## Help \u0026 Contact\n\n[![Discord](https://img.shields.io/discord/256087517353213954.svg?logo=discord)](https://discord.gg/jGZxH9f)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwfcd%2Fworldstate-emitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwfcd%2Fworldstate-emitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwfcd%2Fworldstate-emitter/lists"}