{"id":45384827,"url":"https://github.com/scttdavs/radix-trie","last_synced_at":"2026-02-21T17:25:04.381Z","repository":{"id":25699112,"uuid":"104963518","full_name":"scttdavs/radix-trie","owner":"scttdavs","description":"Radix Trie (in Javascript)","archived":false,"fork":false,"pushed_at":"2023-10-19T22:24:00.000Z","size":213,"stargazers_count":19,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-08T21:25:48.902Z","etag":null,"topics":["javascript","radix-tree","radix-trie","tree","trie"],"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/scttdavs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2017-09-27T02:44:08.000Z","updated_at":"2025-01-13T05:52:28.000Z","dependencies_parsed_at":"2023-09-24T07:15:37.039Z","dependency_job_id":"56470d84-953e-4f05-9ea6-1f74539f9629","html_url":"https://github.com/scttdavs/radix-trie","commit_stats":{"total_commits":75,"total_committers":3,"mean_commits":25.0,"dds":"0.18666666666666665","last_synced_commit":"2e2285c6a13f1addbbfa25ef7d74fe6cbe5fd204"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/scttdavs/radix-trie","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scttdavs%2Fradix-trie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scttdavs%2Fradix-trie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scttdavs%2Fradix-trie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scttdavs%2Fradix-trie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scttdavs","download_url":"https://codeload.github.com/scttdavs/radix-trie/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scttdavs%2Fradix-trie/sbom","scorecard":{"id":806640,"data":{"date":"2025-08-11","repo":{"name":"github.com/scttdavs/radix-trie","commit":"2e2285c6a13f1addbbfa25ef7d74fe6cbe5fd204"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.1,"checks":[{"name":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/scttdavs/radix-trie/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/scttdavs/radix-trie/build.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 0/9 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 26 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":1,"reason":"9 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T11:57:51.371Z","repository_id":25699112,"created_at":"2025-08-23T11:57:51.371Z","updated_at":"2025-08-23T11:57:51.371Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29688232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T15:51:39.154Z","status":"ssl_error","status_checked_at":"2026-02-21T15:49:03.425Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["javascript","radix-tree","radix-trie","tree","trie"],"created_at":"2026-02-21T17:25:03.917Z","updated_at":"2026-02-21T17:25:04.375Z","avatar_url":"https://github.com/scttdavs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Radix Trie (in Javascript)\n\n[![NPM](https://img.shields.io/npm/v/radix-trie-js.svg)](https://www.npmjs.com/package/radix-trie-js)\n![build](https://github.com/scttdavs/radix-trie/actions/workflows/build.yml/badge.svg?branch=master)\n\n\n## Usage\n\nInstall from NPM:\n\n```sh\nnpm i radix-trie-js\n```\n\n```js\nconst RadixTrie = require(\"radix-trie-js\");\n// create a trie with the key of foo and value of 5\nconst trie = new RadixTrie().add(\"foo\", 5);\n```\n\nor create the tree from an object, array or map:\n\n```js\nconst trie = new Trie([\n  [\"foo\", 5],\n  [\"foobar\", 9],\n]);\n\nconst trie = new Trie({\n  foo: 5,\n  foobar: 9,\n});\n\nconst map = new Map([\n  [\"foo\", 5],\n  [\"foobar\", 9],\n]);\nconst trie = new Trie(map);\n```\n\n## Methods\n\n### add\n\nInserts a key with the given value.\n\n```js\nconst trie = new RadixTrie().add(\"bar\", 4);\n```\n\nor insert many at once:\n\n```js\nconst trie = new Trie().add([\n  [\"foo\", 5],\n  [\"foobar\", 9],\n]);\n\nconst map = new Map([\n  [\"foo\", 5],\n  [\"foobar\", 9],\n]);\nconst trie = new Trie().add(map);\n\nconst trie = new Trie().add({\n  foo: 5,\n  foobar: 9,\n});\n```\n\n### delete\n\nDeletes a key/value pair.\n\n```js\nconst trie = new RadixTrie().add(\"foo\", 1).add(\"bar\", 8);\ntrie.get(\"foo\"); // 1\n\ntrie.delete(\"foo\");\n\ntrie.get(\"foo\"); // null\n```\n\n### get\n\nGets the value for a given key.\n\n```js\nconst trie = new RadixTrie().add(\"bar\", 4);\n\ntrie.get(\"bar\");\n// 4\n```\n\n### fuzzyGet\n\nReturns an `iterator` for all the keys and values in the trie that match or partially match a given value regardless of case (upper or lowercase). This is similar to an autocomplete feature, which many tries are used for.\n\n```js\nconst trie = new RadixTrie();\ntrie.add(\"hi\").add(\"Hello\", false);\n\ntrie.fuzzyGet(\"h\").next();\n// { value: [\"hi\", true], done: false }\n\n[...trie.fuzzyGet(\"h\")];\n// [ [\"hi\", true], [\"Hello\", false]]\n\nArray.from(trie.fuzzyGet(\"hel\"));\n// [ [\"Hello\", false] ]\n```\n\n### has\n\nReturns true if the given value exists.\n\n```js\nconst trie = new RadixTrie().add(\"bar\", 4);\n\ntrie.has(\"bar\");\n// true\n```\n\n### entries\n\nReturns an `iterator` for all the keys and values in the trie.\n\n`NOTE:` that order cannot be preserved as a trie is constantly being compressed or expanded with each addition/deletion. In the below example, \"ten\" is first, but is removed later with the addition of \"three\", and the prefix \"t\" is added to consolidate them. So, now \"five\" will be first.\n\n```js\nconst trie = new RadixTrie();\ntrie.add(\"ten\", 10).add(\"five\", 5).add(\"three\", 3);\n\ntrie.entries().next();\n// { value: [\"five\", 5], done: false }\n\n[...trie.entries()];\n// [ [ \"five\", 5 ], [ \"ten\", 10 ], [ \"three\", 3 ] ]\n\nArray.from(trie.entries());\n// [ [ \"five\", 5 ], [ \"ten\", 10 ], [ \"three\", 3 ] ]\n```\n\n### keys\n\nReturns an `iterator` for all the keys in the trie.\n\n`NOTE:` that order cannot be preserved as a trie is constantly being compressed or expanded with each addition/deletion. In the below example, \"ten\" is first, but is removed later with the addition of \"three\", and the prefix \"t\" is added to consolidate them. So, now \"five\" will be first.\n\n```js\nconst trie = new RadixTrie();\ntrie.add(\"ten\", 10).add(\"five\", 5).add(\"three\", 3);\n\ntrie.keys().next();\n// { value: \"five\", done: false }\n\n[...trie.keys()];\n// [ \"five\", \"ten\", \"three\" ]\n\nArray.from(trie.keys());\n// [ \"five\", \"ten\", \"three\" ]\n```\n\n### values\n\nReturns an `iterator` for all the values in the trie.\n\n`NOTE:` that order cannot be preserved as a trie is constantly being compressed or expanded with each addition/deletion. In the below example, \"ten\" is first, but is removed later with the addition of \"three\", and the prefix \"t\" is added to consolidate them. So, now \"five\" will be first.\n\n```js\nconst trie = new RadixTrie();\ntrie.add(\"ten\", 10).add(\"five\", 5).add(\"three\", 3);\n\ntrie.values().next();\n// { value: 5, done: false }\n\n[...trie.values()];\n// [ 5, 10, 3 ]\n\nArray.from(trie.values());\n// [ 5, 10, 3 ]\n```\n\n### toJSON\n\nReturns stringified JSON of all entries.\n\n```js\nconst trie = new RadixTrie({\n  ten: 10,\n  active: false,\n  hello: \"world\"\n});\n\ntrie.toJSON();\n// {\"ten\":10,\"active\":false,\"hello\":\"world\"}\n```\n\n### forEach\n\nExecutes a callback once for each key/value pair. It takes an optional second argument for a `this` value that the callback will be called with.\n\n```js\nconst trie = new RadixTrie().add(\"bar\", 15).add(\"barstool\", false);\n\nlet thisObj = {};\nconst callback = function (key, value) {\n  this[key] = value;\n};\n\ntrie.forEach(callback, thisObj);\n\nthisObj.bar;\n// 15\nthisObj.barstool;\n// false\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscttdavs%2Fradix-trie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscttdavs%2Fradix-trie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscttdavs%2Fradix-trie/lists"}