{"id":21031284,"url":"https://github.com/workable/eip","last_synced_at":"2025-09-01T02:39:20.426Z","repository":{"id":33089352,"uuid":"36726794","full_name":"Workable/eip","owner":"Workable","description":"Aggregator Integration Pattern for node.js","archived":false,"fork":false,"pushed_at":"2023-04-16T14:36:30.000Z","size":233,"stargazers_count":4,"open_issues_count":7,"forks_count":2,"subscribers_count":61,"default_branch":"master","last_synced_at":"2025-08-10T08:47:44.024Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Workable.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2015-06-02T10:51:14.000Z","updated_at":"2024-12-24T19:49:57.000Z","dependencies_parsed_at":"2024-06-21T20:07:16.133Z","dependency_job_id":"dbb94c44-5a8f-47dd-b47a-96afcb9078de","html_url":"https://github.com/Workable/eip","commit_stats":{"total_commits":157,"total_committers":4,"mean_commits":39.25,"dds":"0.14649681528662417","last_synced_commit":"25b85112bc0194f66302db5f18fd5fd71a4572e7"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/Workable/eip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Workable%2Feip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Workable%2Feip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Workable%2Feip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Workable%2Feip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Workable","download_url":"https://codeload.github.com/Workable/eip/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Workable%2Feip/sbom","scorecard":{"id":152201,"data":{"date":"2025-08-11","repo":{"name":"github.com/Workable/eip","commit":"25b85112bc0194f66302db5f18fd5fd71a4572e7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.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 1/30 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":"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":"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":"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":"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":"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":"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":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"19 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6","Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9","Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f","Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p","Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv","Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8","Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65","Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-82v2-mx6x-wq7q","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T10:59:55.046Z","repository_id":33089352,"created_at":"2025-08-16T10:59:55.047Z","updated_at":"2025-08-16T10:59:55.047Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273067641,"owners_count":25039868,"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-09-01T02:00:09.058Z","response_time":120,"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":"2024-11-19T12:27:04.875Z","updated_at":"2025-09-01T02:39:20.389Z","avatar_url":"https://github.com/Workable.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eip\n\nEnterprise Integration Patterns for javascript.\n\nThis repo is based on [jkanschik/node-eip](https://github.com/jkanschik/node-eip) implements various eip patterns for javascript and mainly enhances the aggregator functionality.\n\n## Installation\n\n```\nnpm install --save eip\n```\n\n## Usage\n\n\n### Create a Route\n\n```javascript\nconst eip = require('eip');\nconst route = new eip.Route('Route-0', {route: {retryLimit: 3, retryDelay: 1000}, isErrorRoute:false}, [])\n```\n\n\n### Add a processor to the Route\n\n```javascript\nroute.process(event =\u003e event * 2).info()\n```\n\n### Inject events to Route\n\n```javascript\nroute.inject(1);\n// output: [2017-03-10 17:04:12.636] [INFO] [aggregator-eip] - [Route-0(info-1)] 2\nroute.inject(2);\n// output:  [2017-03-10 17:04:13.082] [INFO] [aggregator-eip] - [Route-0(info-1)] 4\n```\n\n### Builtin Processors\n\n```javascript\naggregate({ timeout = [1000], maxTimes = 3 }) // or\naggregate({ timer= new Timer(), store = new Store(), strategy = new AggregationStrategy() })\n// Timer, Store and AggregationStrategy are abstract classes exported by eip that can be extended.\n// see eip-mongo and eip-rabbit for implementations of Timer on top of rabbitmq and Store on top of mongo\n\ndispatch(route1, route2)\nfilter(event =\u003e event \u003e 5); // or\nfilter(event =\u003e doAsyncStuff(event).then(result =\u003e result \u003e 5)) // filter can accept conditions tha return a promise\nprocess(event =\u003e [event, event]) // custom processor that transforms the event\nprocess(event =\u003e doAsyncStuff(event)) // transform event returning a promise\nthrottle(10, 1000) // 10 events per second (1000 ms)\nthrottleResource({\n  eventsPerPeriod:1,\n  periodInMs:1000\n})\n\n  //or\nthrottleResource({\n  timer: new Timer(),\n  resource: x =\u003e x,\n  pubSub: new PubSub(),\n  queue: new Queue()\n})\n// Timer, PubSub and Queue are abstract classes exported by eip that can be extended.\n// see eip-redis and eip-rabbit for implementations of Timer on top of rabbitmq and pubSub and queue on top of redis\n\n//logging\ntrace()\ndebug()\ninfo()\nwarn()\nerror()\nfatal()\n\n// all logger scan transform the logging msg using a callback\n// eg:\nevent =\u003e 'message to be logged:' + event;\n```\n\n## Aggregator example\n\n```javascript\nconst aggregator = new eip.Route().aggregate({ timeout: [1000], maxTimes: 3 }).info();\n\naggregator.inject({\n  headers: {\n    id: 'the id to aggregate data',\n    param: 'one'\n  },\n  body:'one'});\n\naggregator.inject({\n  headers: {\n    id: 'the id to aggregate data',\n    param: 'two'\n  },\n  body:'two'});\n\naggregator.inject({\n  headers: {\n    id: 'the id to aggregate data',\n    anotherParam: 'other'\n  },\n  body:'three'});\n\n\n// it will be aggregated and log to output:\n// [2017-03-10 16:32:07.605] [INFO] [aggregator-eip] - [Route-1(info-1)] {\"body\":[\"one\",\"two\",\"three\"],\"headers\":{\"status\":\"COMPLETED\",\"id\":\"the id to aggregate data\",\"param\":\"two\",\"anotherParam\":\"other\",\"aggregationNum\":1,\"timeoutNum\":0,\"previousStatus\":\"INITIAL\"}}\n// [2017-03-10 16:32:08.606] [DEBUG] [aggregator-eip] - [Route-1(aggregate-0)] [timeout-1] [1] Already completed\n\n\n// we could have formatted the output using:\naggregator.info(aggregated =\u003e JSON.stringify(aggregated, null, 2));\n/*\n[2017-03-10 16:38:05.484] [INFO] [aggregator-eip] - [Route-1(info-2)] {\n  \"body\": [\n    \"one\",\n    \"two\",\n    \"three\"\n  ],\n  \"headers\": {\n    \"status\": \"COMPLETED\",\n    \"id\": \"the id to aggregate data\",\n    \"param\": \"two\",\n    \"anotherParam\": \"other\",\n    \"aggregationNum\": 1,\n    \"timeoutNum\": 0,\n    \"previousStatus\": \"INITIAL\"\n  }\n}\n[2017-03-10 16:38:06.152] [DEBUG] [aggregator-eip] - [Route-1(aggregate-0)] [timeout-1] [the id to aggregate data] Already completed\n*/\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkable%2Feip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworkable%2Feip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkable%2Feip/lists"}