{"id":19500573,"url":"https://github.com/naturalintelligence/thds","last_synced_at":"2026-02-21T06:13:32.007Z","repository":{"id":256906784,"uuid":"856721114","full_name":"NaturalIntelligence/thds","owner":"NaturalIntelligence","description":"Time Sensitive Data Structure","archived":false,"fork":false,"pushed_at":"2024-09-14T12:21:53.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-20T10:54:31.902Z","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/NaturalIntelligence.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-13T04:42:56.000Z","updated_at":"2024-12-14T17:42:48.000Z","dependencies_parsed_at":"2024-09-14T22:35:45.652Z","dependency_job_id":null,"html_url":"https://github.com/NaturalIntelligence/thds","commit_stats":null,"previous_names":["naturalintelligence/tsds"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NaturalIntelligence/thds","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalIntelligence%2Fthds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalIntelligence%2Fthds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalIntelligence%2Fthds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalIntelligence%2Fthds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NaturalIntelligence","download_url":"https://codeload.github.com/NaturalIntelligence/thds/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalIntelligence%2Fthds/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29675037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T05:54:28.202Z","status":"ssl_error","status_checked_at":"2026-02-21T05:53:42.585Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2024-11-10T22:08:57.007Z","updated_at":"2026-02-21T06:13:31.992Z","avatar_url":"https://github.com/NaturalIntelligence.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# thds\nTime Handling Data Structure in Java script\n\n## Expirable List\nEntries moves to list of expired elements after a certain time. And deleted after defined conditions are met. You can use this datatype in multiple ways, Eg\n- deleting sessions after a predefined inactive time.\n- cache management\n- token expiry\n\n```js\nconst ExpirableList = require(\"tsds/ExpirableList\");\nconst onExpiry = (key, data) =\u003e { ... };\nconst onCleanup = () =\u003e { ... };\n\nconst list = new ExpirableList({\n  entryLifespan: 1000, \n  cleanupInterval: 2500,\n  maxExpiredEntries: 1000\n  },onExpiry, onCleanup);\n\nlist.add(12345);\nlist.add(\"abc\", { data: \"something\"});\nlist.add(\"custom life\", { data: \"something\"}, 1500);\nconst data = list.get(\"abc\");\n:\nlist.delayExpiry(\"abc\"), 600);\n:\nlist.pause(); // pause the list to expire any existing entity\nlist.resume();\n:\nlist.life(12345); // how long a key is in this list\nlist.removeEntry(12345);\n:\nlist.forEachExpired((k,v)=\u003e{\n  :\n});\nlist.forEachNonExpired((k,v)=\u003e{\n  :\n});\n:\nlist.clean(); //to manually clean the list of expired entities\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaturalintelligence%2Fthds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaturalintelligence%2Fthds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaturalintelligence%2Fthds/lists"}