{"id":20744689,"url":"https://github.com/rioam2/bstjs","last_synced_at":"2026-05-15T12:02:10.133Z","repository":{"id":48294223,"uuid":"162954390","full_name":"rioam2/bstjs","owner":"rioam2","description":"🌴 Basic Dictionary ADT implementation using a Binary-Search-Tree (BST) in Javascript","archived":false,"fork":false,"pushed_at":"2021-08-02T22:15:20.000Z","size":22,"stargazers_count":3,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-08T21:54:20.223Z","etag":null,"topics":["binary","bst","bstjs","dictionary","javascript","search","tree"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@rioam2/bstjs","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/rioam2.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":"2018-12-24T05:43:19.000Z","updated_at":"2021-04-15T19:43:09.000Z","dependencies_parsed_at":"2022-08-26T20:00:45.692Z","dependency_job_id":null,"html_url":"https://github.com/rioam2/bstjs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rioam2/bstjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rioam2%2Fbstjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rioam2%2Fbstjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rioam2%2Fbstjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rioam2%2Fbstjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rioam2","download_url":"https://codeload.github.com/rioam2/bstjs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rioam2%2Fbstjs/sbom","scorecard":{"id":776950,"data":{"date":"2025-08-11","repo":{"name":"github.com/rioam2/bstjs","commit":"72d1d56ca3ff7c7a8ff3778483b2461e774dd4a7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"Code-Review","score":0,"reason":"Found 0/26 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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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 5 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"}}]},"last_synced_at":"2025-08-23T03:51:46.999Z","repository_id":48294223,"created_at":"2025-08-23T03:51:46.999Z","updated_at":"2025-08-23T03:51:46.999Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274648279,"owners_count":25324296,"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","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["binary","bst","bstjs","dictionary","javascript","search","tree"],"created_at":"2024-11-17T07:16:50.771Z","updated_at":"2026-05-15T12:02:10.033Z","avatar_url":"https://github.com/rioam2.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BST.js\n\n[![Build Status](https://travis-ci.com/rioam2/bstjs.svg?token=CAdydv8txGmutostKGxE\u0026branch=master)](https://travis-ci.com)\n[![Coverage Status](https://coveralls.io/repos/github/rioam2/bstjs/badge.svg?branch=master)](https://coveralls.io/github/rioam2/bstjs?branch=master)\n[![Typescript Definitions](https://camo.githubusercontent.com/8c16d262a28b65cad19f334906882ae5589e228d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74797065253230646566696e6974696f6e732d5479706553637269707425323076322e352d626c75652e737667)](https://camo.githubusercontent.com/8c16d262a28b65cad19f334906882ae5589e228d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74797065253230646566696e6974696f6e732d5479706553637269707425323076322e352d626c75652e737667)\n[![NPM Version](https://img.shields.io/npm/v/@rioam2/bstjs.svg)](https://github.com/rioam2/bstjs)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://img.shields.io/badge/license-MIT-blue.svg)\n\n\nBSTjs is an npm package for Node.JS that implements the Dictionary ADT using a Binary Search Tree (BST) data structure. The codebase is written in TypeScript with ES6 features which is transpiled to ES5 for compatibility.\n\nFor more information on implementation, please read my development article on Medium here: [Implementation Details](https://medium.com/rio-martinez/how-to-build-a-binary-search-tree-in-javascript-with-es6-classes-any-why-d14cee13d6f7)\n\n## Todo\n\n- [ ] Implement AVL Functionality\n  - [ ] Add height and balance helper methods\n  - [ ] Add callbacks to `findNode` for before/after recursion processes (used for balancing calls).\n- [ ] Add proxy handler for retrieval and setting of data using index operator (`[]`).\n- [ ] Add [iterator definitions](https://codeburst.io/a-simple-guide-to-es6-iterators-in-javascript-with-examples-189d052c3d8e) to wrapper class for use in `for ... of` loops.\n- [ ] Add examples to API documentation.\n\n## Contributing\n\nContributions to this project are more than welcome! If you can help with any of the above todo items, here is a timeline for submitting your work that will ensure peace-of-mind for everyone:\n\n1. If you plan to implement/change anything other than one of the items listed under the todo section, please submit an issue *first*. This way I can approve/deny the prospective changes before you spend your time implementing them.\n2. Once your issue has been approved/verified, please clone the repository and *make all necessary additions/modifications on the development branch*. Please keep the scope of your changes to that specified in step 1 to ensure your pull request will be accepted.\n3. Write tests for your implementation in the `./tests/test.js` file. Once all tests are passing, squash all of your commits and send a pull request. Please do not merge with the master branch yet.\n4. I'll do my best to get back to you in a timely manner with any changes I might see before accepting! Thank you!\n\nIf you feel that I have made any oversights in the contributing checklist above, please let me know by opening an issue.\n\n## API Documentation\n\nThe BST class contains all necessary ADT functionality as specified [here](http://www.algolist.net/Data_structures/Dictionary_(ADT))\n\n- **insert(`key: any`, `value: any`) : `void`**\n\n  Inserts a new key/value pair into the Binary Search Tree\n\n- **get(`key: any`) : `any`**\n\n  Gets the data associated with the supplied key. Returns null if no such key is present in the Binary Search Tree.\n\n- **remove(`key: any`) : `void`**\n\n  Removes data with the supplied key from the Binary Search Tree\n\n- **isEmpty() : `bool`**\n\n  Returns true of no data is in the Binary Search Tree and false if the structure stores any data\n\n- **levelOrderTraversal() : `any[]`**\n\n  Returns an array of values in a level-order traversal of the binary-search-tree.\n\n- **preOrderTraversal() : `any[]`**\n\n  Returns an array of values in a pre-order traversal of the Binary Search Tree\n\n- **inOrderTraversal() : `any[]`**\n\n  Returns an array of values in a post-order traversal of the Binary Search Tree. This traversal will return a sorted array of values based on key by definition.\n\n- **postOrderTraversal() : `any[]`**\n\n  Returns an array of values in a post-order traversal of the Binary Search Tree.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frioam2%2Fbstjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frioam2%2Fbstjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frioam2%2Fbstjs/lists"}