{"id":17482290,"url":"https://github.com/navpreetdevpuri/trie-js","last_synced_at":"2026-05-02T14:33:20.410Z","repository":{"id":143288999,"uuid":"615316431","full_name":"NavpreetDevpuri/trie-js","owner":"NavpreetDevpuri","description":"Trie data structure implementation in javascript ","archived":false,"fork":false,"pushed_at":"2023-03-26T04:46:57.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-19T02:16:35.637Z","etag":null,"topics":["data-structures","javascript","trie","trie-data-structure","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/NavpreetDevpuri.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":"2023-03-17T12:27:50.000Z","updated_at":"2023-03-21T10:29:36.000Z","dependencies_parsed_at":"2023-05-27T12:15:31.793Z","dependency_job_id":null,"html_url":"https://github.com/NavpreetDevpuri/trie-js","commit_stats":{"total_commits":21,"total_committers":2,"mean_commits":10.5,"dds":0.04761904761904767,"last_synced_commit":"48421e94bb7c633e711a40794f0676280991353f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NavpreetDevpuri%2Ftrie-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NavpreetDevpuri%2Ftrie-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NavpreetDevpuri%2Ftrie-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NavpreetDevpuri%2Ftrie-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NavpreetDevpuri","download_url":"https://codeload.github.com/NavpreetDevpuri/trie-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246036013,"owners_count":20713185,"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":["data-structures","javascript","trie","trie-data-structure","typescript"],"created_at":"2024-10-18T23:05:22.884Z","updated_at":"2026-05-02T14:33:20.361Z","avatar_url":"https://github.com/NavpreetDevpuri.png","language":"TypeScript","readme":"# trie-js\n\nTrie data structure implementation in javascript\n\n# Example\n\n```javascript\nconst Trie = require('@navpreetdevpuri/trie-js');\n\nconst names = [\n  'Easton Bass',\n  'Easdon Wilkinson',\n  'Easfon Barreson',\n  'Easgon Barrtera',\n  'Easson banson',\n  'Clarence Barrera',\n  'Heidi Murphy',\n];\n\nconst nodes = [];\nnames.forEach((name) =\u003e {\n  const [firstName, lastName] = name.split(' ');\n  const node = {\n    key: `${firstName}${lastName}`.replace(/\\s/g, ''), // remove spaces\n    value: {\n      firstName,\n      lastName,\n    },\n  };\n  nodes.push(node);\n});\n\nconst trie = new Trie(nodes, true); // caseInsensitive = true\n\nconsole.log(\n  trie.search({\n    skip: 1,\n    limit: 2,\n    prefix: 'Eas',\n    contains: 'son',\n    reverse: false,\n  })\n);\n/* \n[\n  { currPrefix: 'easfonbarreson', values: [ [Object] ] },\n  { currPrefix: 'eassonbanson', values: [ [Object] ] }\n]\n*/\n\nconsole.log(trie.getPreorderPredecessorAndSuccessorForNewkey('eastonbassy'));\n/*\n{\n  predecessorValues: [ { firstName: 'Easton', lastName: 'Bass' } ],\n  successorValues: [ { firstName: 'Heidi', lastName: 'Murphy' } ]\n}\n*/\n\nconsole.log(\n  trie.getPreorderPredecessorAndSuccessorForExistingKey('eastonbass')\n);\n/*\n{\n  predecessorValues: [ { firstName: 'Easson', lastName: 'banson' } ],\n  successorValues: [ { firstName: 'Heidi', lastName: 'Murphy' } ]\n}\n*/\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavpreetdevpuri%2Ftrie-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnavpreetdevpuri%2Ftrie-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavpreetdevpuri%2Ftrie-js/lists"}