{"id":17624576,"url":"https://github.com/admataz/staticfragment","last_synced_at":"2026-05-15T12:02:53.099Z","repository":{"id":57370164,"uuid":"54113683","full_name":"admataz/staticfragment","owner":"admataz","description":"Build multiple variants of a template as static HTML from Handlebars templates and a JSON file","archived":false,"fork":false,"pushed_at":"2016-03-18T22:45:46.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-06T22:47:21.867Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/admataz.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}},"created_at":"2016-03-17T11:45:21.000Z","updated_at":"2016-11-03T20:06:48.000Z","dependencies_parsed_at":"2022-09-26T16:41:06.686Z","dependency_job_id":null,"html_url":"https://github.com/admataz/staticfragment","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/admataz/staticfragment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/admataz%2Fstaticfragment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/admataz%2Fstaticfragment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/admataz%2Fstaticfragment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/admataz%2Fstaticfragment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/admataz","download_url":"https://codeload.github.com/admataz/staticfragment/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/admataz%2Fstaticfragment/sbom","scorecard":{"id":166840,"data":{"date":"2025-08-11","repo":{"name":"github.com/admataz/staticfragment","commit":"fd85f4b85b9218b7af1855829a68f59e27d86c89"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"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":"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":"Code-Review","score":0,"reason":"Found 0/8 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":"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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"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"}}]},"last_synced_at":"2025-08-16T15:09:44.800Z","repository_id":57370164,"created_at":"2025-08-16T15:09:44.800Z","updated_at":"2025-08-16T15:09:44.800Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33066132,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"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":[],"created_at":"2024-10-22T22:04:38.411Z","updated_at":"2026-05-15T12:02:53.078Z","avatar_url":"https://github.com/admataz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# staticfragment\nBuild multiple variants of a template as static HTML from Handlebars templates and a JSON file\n\n## Install:\n`npm install -g staticfragment`\n\n\n## Setup\n\n### JSON data file\n JSON file to define the content for your templates. This should be an object containing a single property `variants` array off the root, which is an array of objects that contain the different data for your template to produce different HTML\n\ne.g.\n``` json\n{\n    \"variants\": {\n        \"default\": {\n            \"Title\": \"Default Test\",\n            \"UI_id\": \"test-default\",\n            \"Items\": [ {\n                    \"FriendlyProductId\": \"D331729\",\n                    \"Description\": \"Item \u003cb\u003e1 Description\u003c/b\u003e\",\n                    \"Image1\": \"http://example.com/item1-image.jpg\",\n                    \"Name\": \"Item 1\",\n                    \"Price\": 85.95,\n                    \"ProductDetailsLink\": \"/item1link\",\n                    \"New\": 1\n                }, {\n                    \"FriendlyProductId\": \"D334611\",\n                    \"Description\": \"Item 2 Description\",\n                    \"Image1\": \"http://example.com/item2--image.jpg\",\n                    \"Name\": \"Item 2\",\n                    \"Price\": 0.0,\n                    \"ProductDetailsLink\": \"/item2link\"\n                }\n            ]\n        },\n        \"varaint-1\": {\n            \"Title\": \"Another Test with a variant\",\n            \"UI_id\": \"test-another-variant\",\n            \"Items\": [ {\n                \"FriendlyProductId\": \"D334611\",\n                \"Description\": \"Item 1 Description\",\n                \"Image1\": \"http://example.com/item1--image.jpg\",\n                \"Name\": \"Item 1 - variant 2\",\n                \"Price\": 0.0,\n                \"ProductDetailsLink\": \"/item2link\"\n            }\n            ]\n        }\n    }\n}\n```\n\n### [Handlebars.js](http://handlebarsjs.com) template\nUse Handlebars to display the data from the json, and some basic simple logic (`if/else`, `each`)\n\ne.g.\n```handlebars\n\u003ch1\u003e{{ Title }}\u003c/h1\u003e\n{{#each Items}}\n  \u003cdiv\u003e\n    \u003ch2\u003e{{Name}}\u003c/h2\u003e\n    \u003cp\u003e\n      {{{ Description}}}\n    \u003c/p\u003e\n  \u003c/div\u003e\n{{/each}}\n\n```\n\n\n\n\n\n## Usage\n\n### Command line\n```\nUsage: staticfragment [options]\n\nOptions:\n\n  -h, --help             output usage information\n  -V, --version          output the version number\n  -o, --output [path    Output dir path (optional)\n  -j, --json \u003cpath\u003e      JSON input\n  -t, --template \u003cpath\u003e  Handlebars.js template file\n  ```\n\n  e.g.\n  ` staticfragment -j ./example/ui-variants.json -t ./example/template.handlebars -o ./build`\n\nreturns a JSON encoded object with the compiled HTML for each variant;\n\n\n\n  ### API\n  ```\n  const staticfragment = require('../');\n  staticfragment(json, template,  [outputDir], callback);\n  ```\n\nNOTE: `outputDir` is optional - if you want to write the output to file - otherwise the results are returned as an object, keyed by variant id\n\n\n  See the [examples](./example) for json data and templates.\n\n\n  ## License\n  The MIT License (MIT)\n  Copyright (c) 2016 Adam Davis\n\n  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\n  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadmataz%2Fstaticfragment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadmataz%2Fstaticfragment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadmataz%2Fstaticfragment/lists"}