{"id":38860118,"url":"https://github.com/shuckster/compose-paths","last_synced_at":"2026-01-17T14:21:12.469Z","repository":{"id":57204887,"uuid":"363538575","full_name":"shuckster/compose-paths","owner":"shuckster","description":"Define paths + routes without the repetition.","archived":false,"fork":false,"pushed_at":"2024-05-07T22:53:01.000Z","size":314,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-25T08:24:04.740Z","etag":null,"topics":["compose","define","folders","hierarchical","paths","tree-structure"],"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/shuckster.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}},"created_at":"2021-05-02T00:56:42.000Z","updated_at":"2024-05-07T22:52:59.000Z","dependencies_parsed_at":"2024-05-07T23:44:28.551Z","dependency_job_id":null,"html_url":"https://github.com/shuckster/compose-paths","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/shuckster/compose-paths","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuckster%2Fcompose-paths","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuckster%2Fcompose-paths/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuckster%2Fcompose-paths/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuckster%2Fcompose-paths/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shuckster","download_url":"https://codeload.github.com/shuckster/compose-paths/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuckster%2Fcompose-paths/sbom","scorecard":{"id":821445,"data":{"date":"2025-08-11","repo":{"name":"github.com/shuckster/compose-paths","commit":"8b0103bcdb532308d40440da8642f74dcd2592ea"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.1,"checks":[{"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":"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":"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":"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":"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":"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: 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":"Vulnerabilities","score":3,"reason":"7 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 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-23T15:42:40.415Z","repository_id":57204887,"created_at":"2025-08-23T15:42:40.415Z","updated_at":"2025-08-23T15:42:40.415Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28509942,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"last_error":"SSL_read: 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":["compose","define","folders","hierarchical","paths","tree-structure"],"created_at":"2026-01-17T14:21:12.415Z","updated_at":"2026-01-17T14:21:12.465Z","avatar_url":"https://github.com/shuckster.png","language":"JavaScript","readme":"\u003ch1 align=\"center\"\u003e\u003ccode\u003ecompose-paths\u003c/code\u003e 🛣\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/shuckster/compose-paths/blob/master/LICENSE\"\u003e\n    \u003cimg\n      alt=\"MIT license\"\n      src=\"https://img.shields.io/npm/l/compose-paths?style=plastic\"\n    /\u003e\u003c/a\u003e\n  \u003ca href=\"https://bundlephobia.com/result?p=compose-paths\"\u003e\n    \u003cimg\n      alt=\"npm bundle size\"\n      src=\"https://img.shields.io/bundlephobia/minzip/compose-paths?style=plastic\"\n    /\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/compose-paths\"\u003e\n    \u003cimg\n      alt=\"Version\"\n      src=\"https://img.shields.io/npm/v/compose-paths?style=plastic\"\n    /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nQuickly throw together a few local paths and have them assigned to aliases or routes.\n\n```js\nconst { composePaths } = require('compose-paths')\n\nconst paths = composePaths(`\n\n  ${__dirname}\n    /src\n      /html\n        /templates      = TEMPLATES\n        /pages          = PAGES\n\n    /public             = PUBLIC\n      /images           = IMAGES\n\n`)\n\npaths.TEMPLATES\n// \"/dir/name/src/html/templates\"\n\npaths.PUBLIC\n// \"/dir/name/public\"\n\npaths.aliases\n// [\"TEMPLATES\", \"PAGES\", \"PUBLIC\", \"IMAGES\"]\n```\n\n`compose-paths` looks at the indentation-level of its input as the cue to concatenate lines together. Either `tabs` or `spaces` should be fine, so long as you're consistent.\n\n## More examples\n\n### `Path` \u0026rarr; `Route` (via aliases and `zip`)\n\n```js\nconst { composePaths, zip } = require('compose-paths')\n\nconst routes = composePaths(`\n    /                   = HOME\n    /about              = ABOUT\n    /contact            = CONTACT\n`)\n\nconst paths = composePaths(`\n  ${__dirname}\n    /src\n      /html/pages\n        /index.html     = HOME\n        /about.html     = ABOUT\n        /contact.html   = CONTACT\n`)\n\nconst staticRoutes = zip(routes, paths)\n\nstaticRoutes.forEach(([route, path]) =\u003e {\n  app.get(route, sendFile(path))\n})\n```\n\n### `Path` \u0026rarr; `Route` (directly)\n\n```js\nconst { composePaths } = require('compose-paths')\n\nconst pathFromRoute = composePaths(`\n\n  ${__dirname}\n    /src/html/pages\n      /index.html        = /\n      /about.html        = /about\n      /contact.html      = /contact\n\n`)\n\npathFromRoute['/']\n// \"/dir/name/src/html/pages/index.html\"\n\npathFromRoute['/contact']\n// \"/dir/name/src/html/pages/contact.html\"\n\npathFromRoute.aliases.forEach(route =\u003e {\n  console.log(pathFromRoute[route])\n})\n```\n\nThat's it!\n\n# Credits\n\n`compose-paths` was written by [Conan Theobald](https://github.com/shuckster/).\n\nDid you find this useful? If so, I like [coffee ☕️](https://www.buymeacoffee.com/shuckster) :)\n\n## License\n\nMIT licensed: See [LICENSE](LICENSE)\n","funding_links":["https://www.buymeacoffee.com/shuckster"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshuckster%2Fcompose-paths","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshuckster%2Fcompose-paths","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshuckster%2Fcompose-paths/lists"}