{"id":13673269,"url":"https://github.com/garronej/evt","last_synced_at":"2025-05-14T15:02:14.396Z","repository":{"id":37910591,"uuid":"81787426","full_name":"garronej/evt","owner":"garronej","description":"💧EventEmitter's typesafe replacement","archived":false,"fork":false,"pushed_at":"2025-01-15T10:24:55.000Z","size":13265,"stargazers_count":464,"open_issues_count":6,"forks_count":7,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-12T10:19:20.767Z","etag":null,"topics":["async-await","browser","deno","eventemitter","node","nodejs","promise","react-native","typescript"],"latest_commit_sha":null,"homepage":"https://evt.land","language":"TypeScript","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/garronej.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"github":["garronej"],"custom":["https://www.ringerhq.com/experts/garronej"]}},"created_at":"2017-02-13T05:14:38.000Z","updated_at":"2025-04-01T07:56:31.000Z","dependencies_parsed_at":"2024-06-18T13:40:37.500Z","dependency_job_id":"7369c2ad-de85-4c9f-9693-df3a394d7acf","html_url":"https://github.com/garronej/evt","commit_stats":{"total_commits":869,"total_committers":9,"mean_commits":96.55555555555556,"dds":"0.42002301495972383","last_synced_commit":"eddfe891308d8aac9c48c7c7ac9a5ec687ffa48b"},"previous_names":[],"tags_count":95,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garronej%2Fevt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garronej%2Fevt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garronej%2Fevt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garronej%2Fevt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/garronej","download_url":"https://codeload.github.com/garronej/evt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254168506,"owners_count":22026176,"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":["async-await","browser","deno","eventemitter","node","nodejs","promise","react-native","typescript"],"created_at":"2024-08-02T10:00:32.310Z","updated_at":"2025-05-14T15:02:13.918Z","avatar_url":"https://github.com/garronej.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\r\n    \u003cimg src=\"https://user-images.githubusercontent.com/6702424/76674598-91ebfc00-65b1-11ea-88df-eb43f04f3cce.png\"\u003e\r\n\u003c/p\u003e\r\n\u003cp align=\"center\"\u003e\r\n    💧\u003ci\u003eEventEmitter's typesafe replacement\u003c/i\u003e💧\r\n    \u003cbr\u003e\r\n    \u003cbr\u003e\r\n    \u003ca href=\"https://github.com/garronej/evt/actions\"\u003e\r\n      \u003cimg src=\"https://github.com/garronej/evt/workflows/ci/badge.svg?branch=main\"\u003e\r\n    \u003c/a\u003e\r\n    \u003ca href=\"https://deno.land/x/evt\"\u003e\r\n        \u003cimg src=\"https://img.shields.io/endpoint?url=https%3A%2F%2Fdeno-visualizer.danopia.net%2Fshields%2Flatest-version%2Fx%2Fevt%2Fmod.ts\"\u003e\r\n    \u003c/a\u003e\r\n    \u003ca href=\"https://www.npmjs.com/package/evt\"\u003e\r\n      \u003cimg src=\"https://img.shields.io/npm/v/evt?logo=npm\"\u003e\r\n    \u003c/a\u003e\r\n    \u003ca href=\"https://bundlephobia.com/package/evt\"\u003e\r\n      \u003cimg src=\"https://img.shields.io/bundlephobia/minzip/evt\"\u003e\r\n    \u003c/a\u003e\r\n    \u003ca href=\"https://www.npmjs.com/package/evt\"\u003e\r\n      \u003cimg src=\"https://img.shields.io/npm/dm/evt\"\u003e\r\n    \u003c/a\u003e\r\n    \u003ca href=\"https://github.com/garronej/evt/blob/main/LICENSE\"\u003e\r\n      \u003cimg src=\"https://img.shields.io/npm/l/evt\"\u003e\r\n    \u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\n\u003c/p\u003e\r\n\u003cp align=\"center\"\u003e\r\n  \u003ca href=\"https://www.evt.land\"\u003eHome\u003c/a\u003e\r\n  -\r\n  \u003ca href=\"https://docs.evt.land\"\u003eDocumentation\u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\n---\r\n\r\n`'evt'` is intended to be a replacement for `'events'`.  \r\nIt makes heavy use of **typescript**'s type inference features to provide **type safety** while keeping things **concise and elegant** 🍸.\r\n\r\n\u003cb\u003eSuitable for any JS runtime env (deno, node, old browsers, react-native ...)\u003c/b\u003e\r\n- ✅ It is both a [Deno](https://deno.land/x/evt) and an [NPM](https://www.npmjs.com/evt) module. ( Achieved with [Denoify](https://github.com/garronej/denoify) ) \r\n- ✅ No external dependencies ([`tsafe`](https://github.com/garronej/tsafe), [`run-exclusive`](https://github.com/garronej/run_exclusive) and [`minimal-polyfills`](https://github.com/garronej/minimal_polyfills) are all from the same author as EVT).\r\n- ✅ [Makes it easy to work with events in React](https://docs.evt.land/react-hooks).  \r\n\r\nCan be imported in TypeScript projects using version TypeScript \u003e= 3.8 (February 20th, 2020) and in any plain JS projects.\r\n\r\n\u003e NOTE: There is very few breaking changes from v1 to v2. [Check them out](https://docs.evt.land/v1-greater-than-v2).  \r\n\r\n# Who is using it\r\n\r\n\u003cp align=\"center\"\u003e\r\n    \u003ca href=\"https://connext.network\"\u003e\r\n        \u003cimg src=\"https://user-images.githubusercontent.com/6702424/84102640-4e1e5c80-aa11-11ea-9d13-df0a65c8cdaf.png\"\u003e\r\n    \u003c/a\u003e\r\n    \u003ca href=\"https://www.semasim.com\"\u003e\r\n        \u003cimg src=\"https://user-images.githubusercontent.com/6702424/84102785-aead9980-aa11-11ea-915b-5c4a5282c44e.png\"\u003e \r\n    \u003c/a\u003e\r\n    \u003cbr\u003e\r\n    \u003ca href=\"https://thegraph.com\"\u003e\r\n        \u003cimg src=\"https://user-images.githubusercontent.com/6702424/179356567-19e2ca0a-9797-4c82-8a45-7e1d0de896a9.png\"\u003e \r\n    \u003c/a\u003e\r\n    \u003ca href=\"https://insee.fr\"\u003e\r\n        \u003cimg src=\"https://user-images.githubusercontent.com/6702424/117936881-a9358f00-b305-11eb-84b9-e61593632bdd.png\"\u003e \r\n    \u003c/a\u003e\r\n    \u003ca href=\"https://www.etalab.gouv.fr/\"\u003e\r\n        \u003cimg src=\"https://user-images.githubusercontent.com/6702424/179345089-3aee6170-e7aa-4b38-adf1-f7d132aa7be4.png\"\u003e \r\n    \u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\n# Install / Import\r\n\r\n## In Deno:\r\n```typescript\r\nimport { Evt } from \"https://deno.land/x/evt/mod.ts\";\r\n```\r\n## Anywhere else:\r\n```bash\r\n$ npm install --save evt\r\n```\r\n```typescript\r\nimport { Evt } from \"evt\"; \r\n```\r\n\r\n# Try it\r\n\r\n\u003cp align=\"center\"\u003e\r\n    \u003cimg src=\"https://user-images.githubusercontent.com/6702424/179363007-582acf54-8f83-42ac-a062-562f8de40d14.gif\"\u003e  \r\n    \u003ca href=\"https://stackblitz.com/edit/evt-playground-gfnidx?file=index.ts\"\u003ePlayground\u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\n# Motivations\r\n\r\nThere are a lot of things that can't easily be done with `EventEmitter`:\r\n\r\n* Enforcing **type safety**.\r\n* Removing a particular listener ( if the callback is an anonymous function ).\r\n* Adding a one-time listener for the next event that meets a condition.\r\n* Waiting \\(via a Promise\\) for one thing or another to happen.  \r\n_Example: waiting at most one second for the next message, stop waiting if the socket disconnects._\r\n\r\nWhy would someone pick EVT over RxJS:  \r\n\r\n* EVT's learning curve is not as steep as RxJS's. \r\n* Generates code that is easier to grasp for people not familiar with reactive programming.\r\n\r\nEVT is an attempt to address all these points while trying to remain as accessible as `EventEmitter`.  \r\n  \r\n\u003c/br\u003e\r\n\r\n\u003cp align=\"center\"\u003e\r\n  \u003ca href=\"https://evt.land\"\u003eGet Started\u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\n# The sticker\r\n\r\n\u003cp align=\"center\"\u003e\r\n    \u003cimg src=\"https://user-images.githubusercontent.com/6702424/90626180-e3607d00-e21a-11ea-9c88-82880ac9cedf.png\"\u003e  \r\n\u003c/p\u003e\r\n\u003cp align=\"center\"\u003e\r\n    \u003ca href=\"https://teespring.com/fr/evt-sticker\"\u003eShop\u003c/a\u003e\r\n\u003c/p\u003e\r\n","funding_links":["https://github.com/sponsors/garronej","https://www.ringerhq.com/experts/garronej"],"categories":["TypeScript","基础设施","Uncategorized","Modules"],"sub_categories":["JAM Stack/静态站点","Uncategorized","Online Playgrounds","Utils","Assistants"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarronej%2Fevt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgarronej%2Fevt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarronej%2Fevt/lists"}