{"id":28250445,"url":"https://github.com/zackurben/event-chain","last_synced_at":"2025-06-14T01:31:08.861Z","repository":{"id":57741959,"uuid":"39363035","full_name":"zackurben/event-chain","owner":"zackurben","description":"A simple way to chain events and control program flow asynchronously.","archived":false,"fork":false,"pushed_at":"2015-07-23T04:39:29.000Z","size":120,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-19T14:19:49.831Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/zackurben.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-20T04:23:45.000Z","updated_at":"2019-08-21T13:29:38.000Z","dependencies_parsed_at":"2022-09-10T22:51:02.325Z","dependency_job_id":null,"html_url":"https://github.com/zackurben/event-chain","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zackurben/event-chain","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackurben%2Fevent-chain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackurben%2Fevent-chain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackurben%2Fevent-chain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackurben%2Fevent-chain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zackurben","download_url":"https://codeload.github.com/zackurben/event-chain/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackurben%2Fevent-chain/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259745034,"owners_count":22905033,"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":"2025-05-19T14:18:13.373Z","updated_at":"2025-06-14T01:31:08.856Z","avatar_url":"https://github.com/zackurben.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# event-chain\nA simple way to chain events and control program flow asynchronously. [![Build Status](https://travis-ci.org/zackurben/event-chain.svg?branch=master)](https://travis-ci.org/zackurben/event-chain)\n\nThis is an open source project under the MIT license, see [LICENSE.md](LICENSE.md) for additional information.\n\n# Install\n```\nnpm install --save event-chain\n```\n\n# Example\n```javascript\nvar chain = require('event-chain')();\n\nvar example = chain.on(['one', 'two'], function() {\n  console.log('foo');\n});\n\nexample.emit('one');\nexample.emit('two');\n// foo to console.\n```\n\n# Debug\nDebugging is made possible with [Debug](https://www.npmjs.com/package/debug) and can be enabled by setting the\nenvironment variable `event-chain`:\n\n```\nenv DEBUG=event-chain\n```\n\n# API\n##### chain.on(events, callback)\n\n```javascript\n/**\n * Create an event-chain that will execute the callback after all the events have been emitted.\n *\n * @param events\n *   An array of events (string) that are required before invoking the callback.\n * @param callback\n *   A callback function to be executed after all the provided events have been fired.\n *\n * @return\n *   A Chain object.\n */\nchain.on(events, callback)\n```\n\n##### chain.emit(event)\n\n```javascript\n/**\n * Emit the given event for the chain.\n *\n * @param event\n *   Emit an event that was previously registered with chain.on();\n */\nfoo.emit(event);\n```\n\n# Options\nCustomized options are available for the chain.\n\n```javascript\nvar chain = require('event-chain')(options);\n```\n\n##### options.complete (optional)\n```\nThe event that is fired once all user-defined events have completed, used internally. Default: '__complete'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzackurben%2Fevent-chain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzackurben%2Fevent-chain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzackurben%2Fevent-chain/lists"}