{"id":19538474,"url":"https://github.com/keyvanakbary/eter","last_synced_at":"2025-04-26T16:30:46.478Z","repository":{"id":19788170,"uuid":"23047335","full_name":"keyvanakbary/eter","owner":"keyvanakbary","description":"Lightweight collections for JavaScript","archived":false,"fork":false,"pushed_at":"2015-12-13T15:25:03.000Z","size":40,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T16:07:09.144Z","etag":null,"topics":["collections","data-structures","javascript","typescript"],"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/keyvanakbary.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":"2014-08-17T18:31:17.000Z","updated_at":"2018-09-15T13:05:37.000Z","dependencies_parsed_at":"2022-08-25T20:51:10.743Z","dependency_job_id":null,"html_url":"https://github.com/keyvanakbary/eter","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyvanakbary%2Feter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyvanakbary%2Feter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyvanakbary%2Feter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyvanakbary%2Feter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keyvanakbary","download_url":"https://codeload.github.com/keyvanakbary/eter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250348832,"owners_count":21415902,"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":["collections","data-structures","javascript","typescript"],"created_at":"2024-11-11T02:34:55.658Z","updated_at":"2025-04-26T16:30:41.469Z","avatar_url":"https://github.com/keyvanakbary.png","language":"TypeScript","readme":"# Eter\n\n[![Build Status](https://secure.travis-ci.org/keyvanakbary/eter.svg?branch=master)](http://travis-ci.org/keyvanakbary/eter)\n\n*Éter* is a conglomerate of lightweight collections for JavaScript running on [node](http://nodejs.org/) and browser.\n\n## Usage\nFor node, [install the package](https://www.npmjs.org/package/eter) and include it\n\n```js\nvar eter = require('eter');\n```\n\nFor the browser, just include the modules you want. You could use [Bower](http://bower.io/) to install the package\n\n    bower install eter --save\n\nAnd include the script\n\n```html\n\u003cscript src=\"path/to/eter/dist/eter.js\"\u003e\u003c/script\u003e\n```\n\n## Types\nIf you use [TypeScript](http://www.typescriptlang.org/), _typings_ are included\n\n```typescript\nimport {Stack} from 'eter';\n\nlet s: Stack\u003cnumber\u003e = new Stack();\n```\n\n## Collections\n\n### Stack\nA [Stack](http://en.wikipedia.org/wiki/Stack_(abstract_data_type)) is a [Last-In-First-Out (LIFO)](http://en.wikipedia.org/wiki/LIFO_(computing)) data structure.\n\n```js\nvar s = new eter.Stack();\n\ns.push(1);\ns.push(2);\ns.pop();//2\ns.pop();//1\ns.isEmpty();//true\ns.pop();//Error \"Empty stack\"\n```\n\n### Queue\nA [Queue](http://en.wikipedia.org/wiki/Queue_(abstract_data_type)) is a [First-In-First-Out (FIFO)](http://en.wikipedia.org/wiki/FIFO_(computing)) data structure.\n\n```js\nvar q = new eter.Queue();\n\nq.enqueue(1);\nq.enqueue(2);\nq.dequeue();//1\nq.dequeue();//2\nq.isEmpty();//true\nq.dequeue();//Error \"Empty queue\"\n```\n\n### LinkedList\nA [Linked List](http://www.wikiwand.com/en/Linked_list) is a data structure consisting of a group of nodes which together represent a sequence.\n\n```js\nvar l = new eter.LinkedList();\n\nl.add(1);\nl.get(0);//1\nl.remove(0);\nl.isEmpty();//true\nl.get(0);//Error \"Index 0 out of bounds\"\n```\n\n### Trie\nA [Trie](http://en.wikipedia.org/wiki/Trie) is an ordered tree data structure that is used to store a dynamic set or associative array where the keys are usually strings.\n\n```js\nvar t = new eter.Trie();\n\nt.insert('one');\nt.insert('oh');\nt.insert('on');\nt.contains('one');//true\nt.insert('foo');\nt.remove('foo');\nt.contains('foo');//false\n```\n\n### Hash Map\nA [Hash Map](http://en.wikipedia.org/wiki/Hash_table) is a data structure used to implement an associative array, a structure that can map keys to values.\n\n```js\nvar m = new eter.HashMap();\n\nm.put('key', 'value');\nm.get('key');//value\nm.contains('key');//true\nm.remove('key');\nm.contains('key');//false\n```\n\n### Binary Tree\nA [Binary Tree](https://en.wikipedia.org/wiki/Binary_tree) is a data structure used for logarithmic search access.\n\n```js\nvar t = new eter.BinaryTree();\n\nt.insert(10, 'value');\nt.get(10);//value\nt.remove(10);\nt.get(10);//null\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeyvanakbary%2Feter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeyvanakbary%2Feter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeyvanakbary%2Feter/lists"}