{"id":43396202,"url":"https://github.com/smizell/treebranch","last_synced_at":"2026-02-02T14:28:56.026Z","repository":{"id":57379661,"uuid":"137559672","full_name":"smizell/treebranch","owner":"smizell","description":"Create domain specific languages. Execute them as code. Serialize them as JSON. Build your own functionality around them.","archived":false,"fork":false,"pushed_at":"2018-06-28T03:04:47.000Z","size":26,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-28T03:10:03.584Z","etag":null,"topics":["dsl","javascript","json","languages"],"latest_commit_sha":null,"homepage":"","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/smizell.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-06-16T06:40:35.000Z","updated_at":"2022-10-23T14:04:50.000Z","dependencies_parsed_at":"2022-09-06T04:51:57.468Z","dependency_job_id":null,"html_url":"https://github.com/smizell/treebranch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/smizell/treebranch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smizell%2Ftreebranch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smizell%2Ftreebranch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smizell%2Ftreebranch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smizell%2Ftreebranch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smizell","download_url":"https://codeload.github.com/smizell/treebranch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smizell%2Ftreebranch/sbom","scorecard":{"id":833600,"data":{"date":"2025-08-11","repo":{"name":"github.com/smizell/treebranch","commit":"b5eab195aa73283ebb570c9deaaf324228b2f868"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/22 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":"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":"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":"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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"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":"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":"Vulnerabilities","score":4,"reason":"6 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg"],"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-23T18:23:36.777Z","repository_id":57379661,"created_at":"2025-08-23T18:23:36.778Z","updated_at":"2025-08-23T18:23:36.778Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29012991,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T12:48:30.580Z","status":"ssl_error","status_checked_at":"2026-02-02T12:46:38.384Z","response_time":58,"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":["dsl","javascript","json","languages"],"created_at":"2026-02-02T14:28:55.865Z","updated_at":"2026-02-02T14:28:56.016Z","avatar_url":"https://github.com/smizell.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tree Branch\n\nCreate domain specific languages. Evaluate them as code. Serialize them as JSON. Build your own functionality around them.\n\n## Overview\n\nProgrammers spend a lot of time trying to squeeze a domain language into a programming language. Sometimes it doesn't fit and they have to start over. Sometimes the domain language gets popular and finds it way into a standardized JSON or YAML format. Sometimes—more often than not—the domain language isn't considered before writing code and is figured out along the way, leading to inconsistencies in the domain language and implementation.\n\nTree Branch is an idea for building domain specific languages in JavaScript that can be evaluated or serialized. Programmers can design the semantics of a language before writing code and later evaluate the code around it or define serializers and deserializers. Because these DSLs can be serialized to something like JSON, they can be shared across the web and across programming languages. Even logic can be shared and evaluated at runtime across networks and platforms given the right design. \n\n## Usage\n\n```sh\nnpm install treebranch\n```\n\n### Create a Language\n\n```javascript\nconst treebranch = require('treebranch');\n\n// Create a language with a name and semantics\nconst l = treebranch.createLanguage({\n  name: 'math', \n  methods: ['add', 'subtract']\n});\n\n// Build a tree from our DSL\nconst tree = l.add(l.subtract(4, 2), 8);\n\n// Serialize the tree\nconst treeList = treebranch.serializers.toList(tree);\n```\n\nThe `tree` value will contain the tree of nodes built from the language. That value will be the equivalent to the following.\n\n```javascript\nconst tree = new ExprNode('add',\n  new ExprNode('subtract', new NumNode(4), new NumNode(2)),\n  new NumNode(8));\n```\n\nThis abstract tree provides the power of this method, because it allows developers to write code that represents the abstract tree one-to-one. Trees can be built on the fly or wrapped with additional functionality.\n\nIn the example above, the `treeList` constant will be the serialized version of the defined tree, with each language node prefixed with the name of the language like below.\n\n```javascript\n['math/add',\n  ['math/subtract', ['number', 4], ['number', 2]],\n  ['number' 8]]]\n```\n\n### Running as Code\n\nNew languages can be created from existing objects, where the property name is the function name and the value is the function to use. After you have built your tree, you can then pass it back in to be evaluated using the defined functions.\n\n```javascript\nconst treebranch = require('treebranch');\n\nconst runtime = treebranch.TreeBranch();\n\n// Pass in a name and functions, which will register your code and create a language for you.\nconst l = runtime.register({\n  name: 'math', \n  methods: {\n    add: (a, b) =\u003e a + b,\n    subtract: (a, b) =\u003e a - b,\n  }\n});\n\nconst tree = l.add(l.subtract(4, 2), 8);\n\nconst result = runtime.eval(tree); // will be 10\n```\n\n## License\n\nThis code is licensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmizell%2Ftreebranch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmizell%2Ftreebranch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmizell%2Ftreebranch/lists"}