{"id":28176069,"url":"https://github.com/cavejay/koala-event","last_synced_at":"2026-05-17T19:38:39.199Z","repository":{"id":78787515,"uuid":"266263369","full_name":"cavejay/koala-event","owner":"cavejay","description":"Manage NodeJS Events by extending EventEmitters to support Koa-like middleware.","archived":false,"fork":false,"pushed_at":"2020-05-24T12:08:05.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-21T18:03:47.498Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cavejay.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-05-23T04:35:37.000Z","updated_at":"2020-05-24T12:01:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"79d91c25-5483-49f8-b922-ff10d6191a4f","html_url":"https://github.com/cavejay/koala-event","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/cavejay/koala-event","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cavejay%2Fkoala-event","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cavejay%2Fkoala-event/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cavejay%2Fkoala-event/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cavejay%2Fkoala-event/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cavejay","download_url":"https://codeload.github.com/cavejay/koala-event/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cavejay%2Fkoala-event/sbom","scorecard":{"id":268172,"data":{"date":"2025-08-11","repo":{"name":"github.com/cavejay/koala-event","commit":"5f145cdac3a1ee67e3fa2c0ec4654e7e52e56bb5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/5 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-17T12:42:11.681Z","repository_id":78787515,"created_at":"2025-08-17T12:42:11.681Z","updated_at":"2025-08-17T12:42:11.681Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279164423,"owners_count":26117697,"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","status":"online","status_checked_at":"2025-10-16T02:00:06.019Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-05-16T00:14:50.666Z","updated_at":"2025-10-16T07:07:58.328Z","avatar_url":"https://github.com/cavejay.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# koala-event\n\nManage NodeJS Events by extending EventEmitter to support Koa-like middleware.\n\n## Install \n\nCurrently not on NPM - just hosted here.\n\n```\nnpm i cavejay/koala-event\n```\n\n## Usage\n\nThe KoalaEvent Class enables the equivalent of `koa.use(fn)`.\n```js\nvar EventEmitter = require(\"events\").EventEmitter;\nconst { KoalaEvent, EventRouter } = require(\"../koala-event\");\n\nvar emitter = new EventEmitter();\nvar eventHandler = new KoalaEvent();\n\n// This function will be run on all emitted events.\neventHandler.use(async function test1(ctx, next) {\n  console.log(\"Print the event Context\", ctx);\n  await next();\n});\n\n/**\n * ctx provided to functions is: \n * {\n *  event: \u003cOriginal Event String\u003e,\n *  data: \u003cOriginal Event's accompanying data\u003e\n * }\n */\n\n// Once the middleware/.use()s are applied then, overwrite an emitter with the an emitter that handles \n// This is similar to Koa's callback()\nemitter.emit = eventHandler.newEmitter(emitter);\n\n// Proceed as normal\nemitter.emit(\"test\", \"hi\");\nemitter.emit(\"something\", \"else\");\nemitter.emit(\"something\", \"else again\");\n```\n\nThe EventRouter Class is very similar to koa-mount's` mount('uri', fn)`. This is an effective replacement for normal events, but supports mutation of context through multiple listeners - similar to processing of a Koa request.\n\n```js\nvar emitter = new EventEmitter();\nconst e = new EventRouter();\n\ne.on(\"test\", (ctx, next) =\u003e {\n  console.log(ctx);\n});\n\ne.on(\"test\", () =\u003e {\n  console.log(\"I won't appear\") // test's first middleware doesn't continue the flow\"\n})\n\ne.on(\"something\", (ctx, next) =\u003e {\n  console.log(ctx);\n  ctx.secret = \"hi\"; // Add the 'secret' after showing the initial ctx\n  next(); // to continue processing listeners to the 'something' event\n});\n\ne.on(\"something\", (ctx, next) =\u003e {\n  console.log(ctx.secret); // the secret appended during an earlier middleware is present.\n});\n\nemitter.emit = e.newEmitter(emitter);\n\nemitter.emit(\"test\", \"hi\");\nemitter.emit(\"something\", \"else\");\nemitter.emit(\"something\", \"again\");\nemitter.emit(\"nothing\", 122); // nothing has no listener. We could make a global listener using .use (just like Koa) should we want to.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcavejay%2Fkoala-event","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcavejay%2Fkoala-event","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcavejay%2Fkoala-event/lists"}