{"id":20129366,"url":"https://github.com/ryanmorr/stache","last_synced_at":"2026-03-08T22:32:32.424Z","repository":{"id":43979036,"uuid":"246355527","full_name":"ryanmorr/stache","owner":"ryanmorr","description":"Micro mustache-style template parser","archived":false,"fork":false,"pushed_at":"2024-09-26T13:35:45.000Z","size":218,"stargazers_count":4,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-20T15:15:48.790Z","etag":null,"topics":["javascript","mustache","parser","tagged-template","template"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryanmorr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-03-10T16:43:50.000Z","updated_at":"2024-07-09T06:54:41.000Z","dependencies_parsed_at":"2024-05-29T00:04:07.041Z","dependency_job_id":"d5553765-45ba-435d-a145-867a462b1382","html_url":"https://github.com/ryanmorr/stache","commit_stats":{"total_commits":24,"total_committers":2,"mean_commits":12.0,"dds":0.04166666666666663,"last_synced_commit":"50137ba41d74992f9e62df5be90c4c981bef7fe8"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ryanmorr/stache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Fstache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Fstache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Fstache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Fstache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanmorr","download_url":"https://codeload.github.com/ryanmorr/stache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanmorr%2Fstache/sbom","scorecard":{"id":792259,"data":{"date":"2025-08-11","repo":{"name":"github.com/ryanmorr/stache","commit":"887a9c404312c561e541cbce78ce887629441597"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"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":"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":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/ryanmorr/stache/node.js.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/ryanmorr/stache/node.js.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   1 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":"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":"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":"Code-Review","score":0,"reason":"Found 0/24 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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: UNLICENSE:0","Info: FSF or OSI recognized license: The Unlicense: UNLICENSE: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 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"}},{"name":"Vulnerabilities","score":1,"reason":"9 existing vulnerabilities detected","details":["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-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5"],"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-23T07:53:44.074Z","repository_id":43979036,"created_at":"2025-08-23T07:53:44.075Z","updated_at":"2025-08-23T07:53:44.075Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30275545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T20:45:49.896Z","status":"ssl_error","status_checked_at":"2026-03-08T20:45:49.525Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["javascript","mustache","parser","tagged-template","template"],"created_at":"2024-11-13T20:33:54.481Z","updated_at":"2026-03-08T22:32:32.410Z","avatar_url":"https://github.com/ryanmorr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stache\n\n[![Version Badge][version-image]][project-url]\n[![License][license-image]][license-url]\n[![Build Status][build-image]][build-url]\n\n\u003e Micro mustache-style template parser\n\n## Install\n\nDownload the [CJS](https://github.com/ryanmorr/stache/raw/master/dist/cjs/stache.js), [ESM](https://github.com/ryanmorr/stache/raw/master/dist/esm/stache.js), [UMD](https://github.com/ryanmorr/stache/raw/master/dist/umd/stache.js) versions or install via NPM:\n\n``` sh\nnpm install @ryanmorr/stache\n```\n\n## Usage\n\nSimilar to how tagged templates parse template literals, stache parses a mustache string template into an array of static strings and an array of the interpolated values:\n\n``` javascript\nimport stache from '@ryanmorr/stache';\n\nconst tpl = stache('{{firstName}} {{lastName}}');\n\nconst [strings, values] = tpl({\n    firstName: 'John',\n    lastName: 'Doe'\n});\n\nconsole.log(strings); //=\u003e [\"\", \" \", \"\"]\nconsole.log(values); //=\u003e [\"John\", \"Doe\"]\n```\n\nIn addition to simple value interpolation, loops, if/else statements, and expressions are also supported:\n\n``` javascript\nconst tpl = stache(`\n    {{each items as item, index}}\n        {{if index === 0}}\n            {{ item + 10 }}\n        {{else if index === 1}}\n            {{ item - 10 }}\n        {{else}}\n            {{ item }}\n        {{/if}}\n    {{/each}}\n`);\n\nconst [strings, values] = tpl({\n    items: [10, 20, 30]\n});\n\nconsole.log(strings); //=\u003e [\"\", \"\", \"\", \"\"]\nconsole.log(values); //=\u003e [20, 10, 30]\n```\n\n## Examples\n\nYou can use the arrays of strings and values to formulate your own custom templating solution. For example, here's a basic string templating engine:\n\n``` javascript\nimport stache from '@ryanmorr/stache';\n\nfunction createTemplate(source) {\n    const tpl = stache(source);\n    return (data) =\u003e {\n        const [strings, values] = tpl(data);\n        return strings.reduce((acc, str, i) =\u003e acc + (values[i - 1]) + str);\n    };\n}\n\nconst tpl = createTemplate(`\n    \u003cul\u003e\n        {{each items as item}}\n            \u003cli\u003e{{item}}\u003c/li\u003e\n        {{/each}}\n    \u003c/ul\u003e\n`);\n\nconst html = tpl({\n    items: ['foo', 'bar', 'baz']\n});\n\nconsole.log(html); //=\u003e \"\u003cul\u003e\u003cli\u003efoo\u003c/li\u003e\u003cli\u003ebar/li\u003e\u003cli\u003ebaz\u003c/li\u003e\u003c/ul\u003e\n```\n\nYou can also combine stache with a tagged template compatible parser for expanded functionality. The following uses [htm](https://github.com/developit/htm) for a hyperscript-based solution:\n\n``` javascript\nimport htm from 'htm';\nimport stache from '@ryanmorr/stache';\n\nconst html = htm.bind((tag, props, ...children) =\u003e {\n    return {tag, props: props || {}, children};\n});\n\nfunction createTemplate(source) {\n    const tpl = stache(source);\n    return (data) =\u003e {\n        const [strings, values] = tpl(data);\n        return html(strings, ...values);\n    };\n}\n\nconst tpl = createTemplate('\u003cdiv id={{id}} onclick={{handler}}\u003e{{content}}\u003c/div\u003e');\n\nconst vnode = tpl({\n    id: 'foo',\n    content: 'bar',\n    handler: () =\u003e console.log('clicked')\n});\n\nconsole.log(vnode); //=\u003e {tag: 'div', props: {id: 'foo', onclick: handler}, children: ['bar']}\n```\n\n## License\n\nThis project is dedicated to the public domain as described by the [Unlicense](http://unlicense.org/).\n\n[project-url]: https://github.com/ryanmorr/stache\n[version-image]: https://img.shields.io/github/package-json/v/ryanmorr/stache?color=blue\u0026style=flat-square\n[build-url]: https://github.com/ryanmorr/stache/actions\n[build-image]: https://img.shields.io/github/actions/workflow/status/ryanmorr/stache/node.js.yml?style=flat-square\n[license-image]: https://img.shields.io/github/license/ryanmorr/stache?color=blue\u0026style=flat-square\n[license-url]: UNLICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanmorr%2Fstache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanmorr%2Fstache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanmorr%2Fstache/lists"}