{"id":40529386,"url":"https://github.com/unixs/node-btree","last_synced_at":"2026-01-20T21:38:22.994Z","repository":{"id":35207153,"uuid":"204726201","full_name":"unixs/node-btree","owner":"unixs","description":"Native binary tree for Node.js. Bindings to GLib Balanced Binary Tree (GTree)","archived":false,"fork":false,"pushed_at":"2026-01-01T19:32:39.000Z","size":1017,"stargazers_count":2,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-07T03:41:27.165Z","etag":null,"topics":["btrees","glib2","nodejs"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unixs.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-08-27T14:52:54.000Z","updated_at":"2026-01-01T19:32:38.000Z","dependencies_parsed_at":"2024-02-09T19:46:34.422Z","dependency_job_id":"3a9ea794-176a-4660-9121-5c8ba12f1ad3","html_url":"https://github.com/unixs/node-btree","commit_stats":{"total_commits":137,"total_committers":4,"mean_commits":34.25,"dds":0.3868613138686131,"last_synced_commit":"9f6c768dc6694c21612b593c8b6b5002bad4e65d"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/unixs/node-btree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unixs%2Fnode-btree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unixs%2Fnode-btree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unixs%2Fnode-btree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unixs%2Fnode-btree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unixs","download_url":"https://codeload.github.com/unixs/node-btree/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unixs%2Fnode-btree/sbom","scorecard":{"id":910561,"data":{"date":"2025-08-11","repo":{"name":"github.com/unixs/node-btree","commit":"f725753f063351b50d2a7f2414a6b4af6d53911d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Maintained","score":0,"reason":"1 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":"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":"Code-Review","score":0,"reason":"Found 0/25 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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/nodejs.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":"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: GNU Lesser General Public License v3.0: 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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/unixs/node-btree/nodejs.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/unixs/node-btree/nodejs.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/nodejs.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/unixs/node-btree/nodejs.yml/master?enable=pin","Warn: containerImage not pinned by hash: docker/ubuntu-latest-tests.dockerfile:1: pin your Docker image by updating ubuntu:latest to ubuntu:latest@sha256:7c06e91f61fa88c08cc74f7e1b7c69ae24910d745357e0dfe1d2c0322aaf20f9","Warn: containerImage not pinned by hash: docker/ubuntu-legacy-tests.dockerfile:1: pin your Docker image by updating ubuntu:focal to ubuntu:focal@sha256:8feb4d8ca5354def3d8fce243717141ce31e2c428701f6682bd2fafe15388214","Warn: downloadThenRun not pinned by hash: docker/ubuntu-latest-tests.dockerfile:9-18","Warn: npmCommand not pinned by hash: docker/ubuntu-latest-tests.dockerfile:9-18","Warn: downloadThenRun not pinned by hash: docker/ubuntu-legacy-tests.dockerfile:9-18","Warn: npmCommand not pinned by hash: docker/ubuntu-legacy-tests.dockerfile:9-18","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   2 containerImage dependencies pinned","Info:   0 out of   2 downloadThenRun dependencies pinned","Info:   0 out of   2 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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 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":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4"],"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-24T18:57:55.745Z","repository_id":35207153,"created_at":"2025-08-24T18:57:55.745Z","updated_at":"2025-08-24T18:57:55.745Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28614772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T18:56:40.769Z","status":"ssl_error","status_checked_at":"2026-01-20T18:54:26.653Z","response_time":117,"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":["btrees","glib2","nodejs"],"created_at":"2026-01-20T21:38:22.864Z","updated_at":"2026-01-20T21:38:22.988Z","avatar_url":"https://github.com/unixs.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-btree\n\n[![NPM](https://nodei.co/npm/node-btree.png?compact=true)](https://nodei.co/npm/node-btree/)\n\n[![Node.js CI](https://github.com/unixs/node-btree/workflows/Node.js%20CI/badge.svg)](https://github.com/unixs/node-btree/actions)\n[![codecov](https://codecov.io/gh/unixs/node-btree/branch/codecov/graph/badge.svg?token=S389BKWNUK)](https://codecov.io/gh/unixs/node-btree)\n[![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0)\n[![GitHub issues](https://img.shields.io/github/issues-raw/unixs/node-btree)](https://github.com/unixs/node-btree/issues)\n\n## Brief\n\nNode.js native Balanced Binary Tree bindings to [GTree from GLib](https://docs.gtk.org/glib/struct.Tree.html).\n\nWriten on C with [N-API](https://nodejs.org/dist/latest-v12.x/docs/api/n-api.html).\nThe module implements Map interface: `set()`, `get()`, `has()`, etc.\nIt has one additional property: `height` that store bTree height, and natively support map/reduce/filter operations.\n\n## Latest release changes\n\nSee: [CHANGELOG.md](https://github.com/unixs/node-btree/blob/master/CHANGELOG.md)\n\n## Documentation\n\nSee: [GitHub Wiki](https://github.com/unixs/node-btree/wiki/API)\n\n## Limitations\n\n* **All methods will compiled for GLIB version \u003e= 2.68 only!**\n\n* Same as GTree:\n\n\u003e The tree may not be modified while iterating over it (you can't add/remove items).\n\n* Node.js \u003e= 12.\n\n* Support building on POSIX platforms only at this moment.\n\n## Dependency \u0026 build\n\n* [CMake tool](https://cmake.org/).\n* pkg-config tool (on POSIX)\n* libglib binary \u0026 C headers\n\nOn Ubuntu GNU/Linux this packages must be installed:\n\n* cmake\n* build-essentials\n* libglib2.0-dev\n\nOn MacOS use **brew** and install:\n\n* cmake\n* pkg-config\n* glib\n\n## Usage\n\n```js\n/**\n * Basic\n */\n\nconst { BTree } = require(\"node-btree\");\n\nfunction comparator(a, b) {\n  if (a \u003e b) {\n    return 1;\n  }\n  else if (a \u003c b) {\n    return -1;\n  }\n  else {\n    return 0;\n  }\n}\n\nconst btree = new BTree(comparator);\n\nbtree.set(\"50\", 50);\nbtree.set(\"30\", 30);\nbtree.set(\"15\", 150);\n\nbtree.get(\"15\");\n// 150\nbtree.has(\"30\");\n// true\n\n\nbtree.forEach((val, key) =\u003e {\n  console.log(key, val);\n});\n// \"15\" 150\n// \"30\" 30\n// \"50\" 50\n\nbtree.map((val) =\u003e val);\n// [150, 30, 50]\n\nbtree.reduce((acc, val) =\u003e acc + val, 0);\n// 230\n\nbtree.size;\n// 3\nbtree.height;\n// 2\n\n/**\n * From Map()\n */\n\nconst map = new Map();\n\nmap.set(10, \"10\");\nmap.set(30, \"30\");\nmap.set(80, \"80\");\nmap.set(20, \"20\");\nmap.set(50, \"50\");\n\nconst btree2 = BTree.from(comparator, map);\n\nbtree.size;\n// 5\nbtree.get(30);\n// \"30\"\n\n/**\n * From iterable\n */\n\nfunction* generator() {\n  for (let i = 0; i \u003c 1000; i++) {\n    yield {\n      key: i,\n      value: `${i}`\n    };\n  }\n}\n\nconst btree = BTree.from(comparator, generator());\n\nbtree.size;\n// 1000\nbtree.height;\n// 10\nbtree.get(500);\n// \"500\"\n\n```\n\nSee more docs here: [GitHub Wiki](https://github.com/unixs/node-btree/wiki/API)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funixs%2Fnode-btree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funixs%2Fnode-btree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funixs%2Fnode-btree/lists"}