{"id":15495117,"url":"https://github.com/samchon/ecol","last_synced_at":"2025-04-22T20:27:48.951Z","repository":{"id":57219346,"uuid":"124403076","full_name":"samchon/ecol","owner":"samchon","description":"Event Collections","archived":false,"fork":false,"pushed_at":"2020-01-14T11:21:35.000Z","size":57,"stargazers_count":10,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-20T03:32:20.257Z","etag":null,"topics":["collection","deque","event","hashmap","list","stl","treemap","typescript","vector"],"latest_commit_sha":null,"homepage":"","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/samchon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-08T14:28:16.000Z","updated_at":"2025-03-27T12:34:05.000Z","dependencies_parsed_at":"2022-08-28T23:22:33.911Z","dependency_job_id":null,"html_url":"https://github.com/samchon/ecol","commit_stats":null,"previous_names":["samchon/econ"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samchon%2Fecol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samchon%2Fecol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samchon%2Fecol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samchon%2Fecol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samchon","download_url":"https://codeload.github.com/samchon/ecol/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250317979,"owners_count":21410855,"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":["collection","deque","event","hashmap","list","stl","treemap","typescript","vector"],"created_at":"2024-10-02T08:16:09.774Z","updated_at":"2025-04-22T20:27:48.905Z","avatar_url":"https://github.com/samchon.png","language":"TypeScript","readme":"# **E**vent **Col**lections\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/samchon/ecol/blob/master/LICENSE)\n[![npm version](https://badge.fury.io/js/ecol.svg)](https://www.npmjs.com/package/ecol)\n[![Downloads](https://img.shields.io/npm/dm/ecol.svg)](https://www.npmjs.com/package/ecol)\n[![Build Status](https://github.com/samchon/ecol/workflows/build/badge.svg)](https://github.com/samchon/ecol/actions?query=workflow%3Abuild)\n[![Chat on Gitter](https://badges.gitter.im/samchon/ecol.svg)](https://gitter.im/samchon/ecol?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nExtension of [TypeScript-STL](https://github.com/samchon/tstl) **Con**tainers dispatching **E**vents.\n\n**TSTL** is an open-source project providing features of STL, migrated from *C++* to *TypeScript*. You can enjoy the STL's own specific *containers*, *algorithms* and *functors* in the JavaScript. If TypeScript, you also can take advantage of type restrictions and generic programming with the TypeScript. \n\n**ECOL** is an extension module of such **TSTL**, providing special collections dispatching events. The special collections are almost similar with the original STL Containers, but you also can observe elements' I/O events with the special collections. Types of the event dispatched by the special collections are `\"insert\"`, `\"erase\"` and `\"refresh\"`.\n\n\n\n## Features\n### Linear Collections\n  - ArrayCollection\n  - DequeCollection\n  - ListCollection\n\n### Set Containers\n  - *Tree-based Collections*\n    - TreeSetCollection\n    - TreeMultiSetCollection\n  - *Hash-buckets based Collections*\n    - HashSetCollection\n    - HashMultiSetCollection\n\n### Map Collections\n  - *Tree-based Collections*\n    - TreeMapCollection\n    - TreeMultiMapCollection\n  - *Hash-buckets based Collections*\n    - HashMapCollection\n    - HashMultiMapCollection\n\n\n\n## Installation\n### NPM Module\nInstalling **ECOL** in *NodeJS* is very easy. Just install with the `npm`.\n\n```bash\n# Install TSTL from the NPM module\nnpm install --save ecol\n```\n\n### Usage\n``` typescript\nimport {TreeMapCollection} from \"ecol\";\n\nfunction listener(event: TreeMapCollection.Event\u003cnumber, string\u003e): void\n{\n    console.log(\"Event type is: \" + event.type);\n\n    for (let it = event.first; !it.equals(event.last); it = it.next())\n        console.log(\"\\t\", \"An element by that event:\", it.value);\n}\n\nfunction main(): void\n{\n    // CONSTRUCT EVENT TREE-MAP\n    let map: TreeMapCollection\u003cnumber, string\u003e = new TreeMapCollection();\n    map.addEventListener(\"insert\", listener);\n    map.addEventListener(\"erase\", listener);\n\n    // DISPATCHES INSERT EVENT\n    map.set(1, \"One\");\n    map.set(2, \"Two\");\n    map.set(3, \"Three\");\n\n    // DISPATCHES ERASE EVENT\n    map.erase(2);\n    map.erase(3);\n\n    // DISPATCHES REFRESH EVENT\n    map.set(2, \"Second\"); // AUTOMATIC\n    map.refresh(); // BY USER\n}\nmain();\n```\n\n\n\n## References\n  - **Repositories**\n    - [GitHub Repository](https://github.com/samchon/ecol)\n    - [NPM Repository](https://www.npmjs.com/package/ecol)\n  - **Documents**\n    - [**Guide Documents**](https://github.com/samchon/ecol/wiki)\n    - [API Documents](http://samchon.github.io/ecol/api)\n  - **Dependency**\n    - [TypeScript-STL](https://github.com/samchon/tstl)","funding_links":[],"categories":["Built with TypeScript"],"sub_categories":["Libraries"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamchon%2Fecol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamchon%2Fecol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamchon%2Fecol/lists"}