{"id":16644177,"url":"https://github.com/75lb/composite-class","last_synced_at":"2025-10-30T12:30:31.402Z","repository":{"id":57213493,"uuid":"51319628","full_name":"75lb/composite-class","owner":"75lb","description":"An isomorphic JavaScript class for building composite structures.","archived":false,"fork":false,"pushed_at":"2024-08-22T18:23:34.000Z","size":158,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-24T21:32:17.893Z","etag":null,"topics":["composite","design-pattern","es6","esm","isomorphic","javascript","javascript-library","load-anywhere","nodejs"],"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/75lb.png","metadata":{"files":{"readme":"README.hbs","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":"2016-02-08T19:06:06.000Z","updated_at":"2025-01-12T03:44:42.000Z","dependencies_parsed_at":"2024-06-19T04:09:01.935Z","dependency_job_id":"961a4bb9-4257-4643-a76f-11c69948ecea","html_url":"https://github.com/75lb/composite-class","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/75lb/composite-class","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fcomposite-class","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fcomposite-class/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fcomposite-class/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fcomposite-class/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/75lb","download_url":"https://codeload.github.com/75lb/composite-class/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fcomposite-class/sbom","scorecard":{"id":5631,"data":{"date":"2025-08-11","repo":{"name":"github.com/75lb/composite-class","commit":"fc766bc74d608b558d207ddb17a91a90ae037f18"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"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":"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/30 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":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/node.js.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":"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":"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":"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/node.js.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/75lb/composite-class/node.js.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/75lb/composite-class/node.js.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/node.js.yml:28","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 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":"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":"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":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":"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":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv"],"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-14T13:28:54.837Z","repository_id":57213493,"created_at":"2025-08-14T13:28:54.837Z","updated_at":"2025-08-14T13:28:54.837Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281087964,"owners_count":26441675,"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-10-26T02:00:06.575Z","response_time":61,"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":["composite","design-pattern","es6","esm","isomorphic","javascript","javascript-library","load-anywhere","nodejs"],"created_at":"2024-10-12T08:10:41.444Z","updated_at":"2025-10-30T12:30:31.365Z","avatar_url":"https://github.com/75lb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![view on npm](https://badgen.net/npm/v/composite-class)](https://www.npmjs.org/package/composite-class)\n[![npm module downloads](https://badgen.net/npm/dt/composite-class)](https://www.npmjs.org/package/composite-class)\n[![Gihub repo dependents](https://badgen.net/github/dependents-repo/75lb/composite-class)](https://github.com/75lb/composite-class/network/dependents?dependent_type=REPOSITORY)\n[![Gihub package dependents](https://badgen.net/github/dependents-pkg/75lb/composite-class)](https://github.com/75lb/composite-class/network/dependents?dependent_type=PACKAGE)\n[![Node.js CI](https://github.com/75lb/composite-class/actions/workflows/node.js.yml/badge.svg)](https://github.com/75lb/composite-class/actions/workflows/node.js.yml)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)\n\n# composite-class\n\nAn isomorphic, load-anywhere JavaScript class for building [composite structures](https://en.wikipedia.org/wiki/Composite_pattern). Suitable for use as a super class or mixin.\n\n## Synopsis\n\nThe `Composite` class implements the [composite design pattern](https://en.wikipedia.org/wiki/Composite_pattern), useful for building and traversing tree structures. For example, build a composite structure representing the French government:\n\n```js\nconst Composite = require('composite-class')\n\nclass Person extends Composite {\n  constructor (name, role) {\n    super()\n    this.name = name\n    this.role = role\n  }\n\n  toString () {\n    return `${this.name} [${this.role}]`\n  }\n}\n\nconst government = new Person('Gouvernement de la République française', 'Government')\nconst headOfState = new Person('Emmanuel Macron', 'Head of State')\nconst primeMinister = new Person('Édouard Philippe', 'Prime Minister')\nconst ministerArmedForces = new Person('Florence Parly', 'Minister of the Armed Forces')\nconst ministerEconomy = new Person('Bruno Le Maire', 'Minister of Finance and the Economy')\n\ngovernment.add(headOfState)\nheadOfState.add(primeMinister)\nprimeMinister.add(ministerArmedForces)\nprimeMinister.add(ministerEconomy)\n\nconsole.log(government.tree())\n```\n\nOutput.\n\n```\n- Gouvernement de la République française [Government]\n  - Emmanuel Macron [Head of State]\n    - Édouard Philippe [Prime Minister]\n      - Florence Parly [Minister of the Armed Forces]\n      - Bruno Le Maire [Minister of Finance and the Economy]\n```\n\nThe `Composite` class implements an [iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterator_protocol) interface, therefore can be iterated using standard JavaScript methods.\n\n```js\nfor (const person of government) {\n  console.log('Processing:', person.name)\n}\n```\n\nOutput.\n\n```\nProcessing: Gouvernement de la République française\nProcessing: Emmanuel Macron\nProcessing: Édouard Philippe\nProcessing: Florence Parly\nProcessing: Bruno Le Maire\n```\n\n{{\u003emain}}\n\n## Load anywhere\n\nThis library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation.\n\nNode.js:\n\n```js\nconst Composite = require('composite-class')\n```\n\nWithin Node.js with ECMAScript Module support enabled:\n\n```js\nimport Composite from 'composite-class'\n```\n\nWithin an modern browser ECMAScript Module:\n\n```js\nimport Composite from './node_modules/composite-class/index.mjs'\n```\n\nOld browser (adds `window.Composite`):\n\n```html\n\u003cscript nomodule src=\"./node_modules/composite-class/dist/index.js\"\u003e\u003c/script\u003e\n```\n\n* * *\n\n\u0026copy; 2016-24 Lloyd Brookes \\\u003c75pound@gmail.com\\\u003e.\n\nTest suite by [test-runner](https://github.com/test-runner-js/test-runner). Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F75lb%2Fcomposite-class","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F75lb%2Fcomposite-class","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F75lb%2Fcomposite-class/lists"}