{"id":26981044,"url":"https://github.com/scarletsfiction/eventpine","last_synced_at":"2026-05-01T23:39:21.228Z","repository":{"id":57231350,"uuid":"294542263","full_name":"ScarletsFiction/EventPine","owner":"ScarletsFiction","description":"A simple extendable event emitter class","archived":false,"fork":false,"pushed_at":"2020-10-02T08:14:14.000Z","size":8,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T16:16:12.824Z","etag":null,"topics":["browser","deno","event","event-emitter","node-js"],"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/ScarletsFiction.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}},"created_at":"2020-09-10T23:08:27.000Z","updated_at":"2020-09-14T10:00:51.000Z","dependencies_parsed_at":"2022-09-26T16:32:26.490Z","dependency_job_id":null,"html_url":"https://github.com/ScarletsFiction/EventPine","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScarletsFiction%2FEventPine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScarletsFiction%2FEventPine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScarletsFiction%2FEventPine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScarletsFiction%2FEventPine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ScarletsFiction","download_url":"https://codeload.github.com/ScarletsFiction/EventPine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247024157,"owners_count":20870940,"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":["browser","deno","event","event-emitter","node-js"],"created_at":"2025-04-03T15:20:10.890Z","updated_at":"2025-10-31T08:45:46.864Z","avatar_url":"https://github.com/ScarletsFiction.png","language":"JavaScript","funding_links":["https://patreon.com/stefansarya'","https://www.patreon.com/stefansarya"],"categories":[],"sub_categories":[],"readme":"\u003ca href='https://patreon.com/stefansarya'\u003e\u003cimg src='https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.herokuapp.com%2Fstefansarya%2Fpledges\u0026style=for-the-badge' height='20'\u003e\u003c/a\u003e\n[![Software License](https://img.shields.io/badge/License-MIT-brightgreen.svg)](LICENSE)\n[![](https://data.jsdelivr.com/v1/package/npm/eventpine/badge)](https://www.jsdelivr.com/package/npm/eventpine)\n[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=EventPine%20is%20a%20simple%20extendable%20event%20emitter%20class\u0026url=https://github.com/ScarletsFiction/EventPine\u0026via=github\u0026hashtags=eventpine,browser,node,deno)\n\n# EventPine\nA simple extendable event emitter class for Deno, Node, and Browser.\n\n### Getting Started\nBefore we start to use EventPine we need to import it first.\n\n#### Deno\nPut this on your first line\n```js\nimport 'https://x.nest.land/EventPine@1.0.2/mod.js';\n```\n\n#### Node\nAdd the module using package manager\n```sh\n$ npm i eventpine\n```\n\nThen import it to your script\n```js\nlet EventPine = require('eventpine');\n```\n\n#### Browser\nPut this on HTML `\u003chead\u003e`\n```xml\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/eventpine@latest\"\u003e\u003c/script\u003e\n```\n\n### How to use\nEventPine can be extended with your custom class.\n\n```js\n// Custom class with EventPine (Optional)\nclass MyCustom extends EventPine{/* ... */}\nvar obj = new MyCustom();\n\n// Or just create from the root\nvar obj = new EventPine();\n\n// The next section also use this 'obj'\n```\n\n### On\nListen to an event.\n\n```js\nobj.on('message' /* EventName */, function(data1, data2){\n  // Do something\n});\n```\n\n### Once\nListen to an event then remove it after being called.\n\n```js\nobj.once('message' /* EventName */, function(data1, data2){\n  // Do something once\n});\n```\n\n### Off\nRemove event listener registered by on/once.\n\n```js\n// Remove specific callback listener to this event\nobj.off('message', myFunction);\n\n// Remove all event listener to this event name\nobj.off('message');\n\n// Clear all event including the internal event\nobj.off();\n```\n\nIf the second argument was empty, every callback related to this EventName will be removed.\u003cbr\u003e\n\n### Emit\nEmit to events that was registered.\n\n```js\nobj.emit('message' /* EventName */, 'data1', 'data2', ...);\n```\n\n## Internal Event\nThere are some internal event that may be useful.\n\n|EventName|Arguments|Description|\n|---|---|---|\n|`*`|EventName, ...|Wildcards event, everytime `emit` was called|\n\n```js\nobj.on('*', function(...){\n  // Do stuff\n});\n```\n\nInstead of wildcard there are another experimental internal event, they're not documented yet because may be changed on the future.\n\n## Contribution\nIf you want to help in EventPine please fork this project and edit on your repository, then make a pull request to here. Otherwise, you can help with donation via [patreon](https://www.patreon.com/stefansarya).\n\nBut don't forget to put a link to this repository, or share it maybe.\n\n## License\nEventPine is under the MIT license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscarletsfiction%2Feventpine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscarletsfiction%2Feventpine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscarletsfiction%2Feventpine/lists"}