{"id":16355889,"url":"https://github.com/jwilson8767/template-literals-cli","last_synced_at":"2026-05-03T07:47:48.136Z","repository":{"id":77732057,"uuid":"149611490","full_name":"jwilson8767/template-literals-cli","owner":"jwilson8767","description":"Provides a simple way to build ES6 Template Literals into static html files with an optional yaml or json config/data file. ","archived":false,"fork":false,"pushed_at":"2025-08-05T03:05:28.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-05T03:33:40.270Z","etag":null,"topics":["es6","npm","npm-scripts","template-engine-html","template-literals"],"latest_commit_sha":null,"homepage":null,"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/jwilson8767.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-20T13:12:43.000Z","updated_at":"2025-08-05T03:05:31.000Z","dependencies_parsed_at":"2023-03-01T14:16:16.593Z","dependency_job_id":null,"html_url":"https://github.com/jwilson8767/template-literals-cli","commit_stats":{"total_commits":18,"total_committers":3,"mean_commits":6.0,"dds":"0.38888888888888884","last_synced_commit":"7f07e944a1d3fcbc186ab64b8d2dd68dbd4d59a9"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/jwilson8767/template-literals-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwilson8767%2Ftemplate-literals-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwilson8767%2Ftemplate-literals-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwilson8767%2Ftemplate-literals-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwilson8767%2Ftemplate-literals-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwilson8767","download_url":"https://codeload.github.com/jwilson8767/template-literals-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwilson8767%2Ftemplate-literals-cli/sbom","scorecard":{"id":545315,"data":{"date":"2025-08-11","repo":{"name":"github.com/jwilson8767/template-literals-cli","commit":"8bef5b9ce6bdceb52f9ffe10db1a2f04c037d13a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"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":"Maintained","score":0,"reason":"1 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":"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":"Code-Review","score":0,"reason":"Found 0/19 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":"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":"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":"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":"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":"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":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"}}]},"last_synced_at":"2025-08-20T09:21:00.522Z","repository_id":77732057,"created_at":"2025-08-20T09:21:00.522Z","updated_at":"2025-08-20T09:21:00.522Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32562118,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"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":["es6","npm","npm-scripts","template-engine-html","template-literals"],"created_at":"2024-10-11T01:42:05.454Z","updated_at":"2026-05-03T07:47:48.130Z","avatar_url":"https://github.com/jwilson8767.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deprecated, please use new version [here](https://github.com/jcary741/template-literals-cli).\n\n# template-literals-cli\n\n\u003e Templates so literal, a barbarian can do it\n\nProvides a simple way to build [ES6 Template Literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) into static html files with an optional yaml or json config/data file. \n\n## Getting started\n1. Install via `npm install template-literals-cli -g`\n\n2. Create a config/data file using either YAML or json. For example `mydata.yml`:\n```yaml\nfire_hot: true\nexclamations: \n  - 'UYGH!'\n  - 'GRRAH!'\n  - 'OOAH!' \ncolors:\n  - 'red'\n  - 'orange'\n  - 'yellow'\n```\n\n3. Create a template file which exports a default function. For example `touchfire.js`:\n```js\nexport default (config)=\u003e`\n\u003chtml\u003e\n    \u003cbody\u003e\n        \u003ch1\u003e${ config['fire_hot'] ? config['exclamations'][Math.floor(Math.random() * config['exclamations'].length)] : 'Wha'}\u003c/h1\u003e\n        \n        \u003ch3\u003e${ config['exclamations'].join(' ') }\u003c/h3\u003e\n        \n        \u003cdiv\u003e\n            ${ config['fire_hot'] ? config['exclamations'].map((exclamation, index)=\u003e`\n                \u003cspan style=\"color: ${config.colors[index]}; padding: 1rem;\"\u003e${exclamation}\u003c/span\u003e\n            `).join(''):'' }\n        \u003c/div\u003e\n    \u003c/body\u003e\n\u003c/html\u003e\n`\n```\n\n3. Build the file into `dist/touchfire.html` using `template-literals --config config.yml --outdir dist touchfire.js`\n\n4. (optional) Start the http server of your choice in `dist/` and visit `http://localhost/touchfire.html`. Optionally you can build again using `template-literals --config config.yml --outdir dist --indexes touchfire.js` and then visit `http://localhost/touchfire/` if you want a prettier url.\n\n5. (optional) Add the npm script below to your project's `package.json` so can just run `npm run build` instead of remembering your exact build command:\n```json\n{\n\"scripts\": {\n    \"build\": \"template-literals --config config.yml --outdir dist --indexes src/*.js\"\n    }\n}\n``` \nNote that the wildcard is expanded by your terminal and therefore may not work on Windows/wherever glob is not available.\n\n## Importing other templates\nUsing templates from other files is easy, just import the desired template like this:\n```js\n// File: templates/header.js\nexport default (config)=\u003e`\n\u003cnav class=\"menu\"\u003e\n  \u003cul\u003e\n    \u003cli\u003e\u003ca href=\"#\"\u003eHome\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#\"\u003eAbout\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#\"\u003eContact\u003c/a\u003e\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/nav\u003e\n`\n// end file\n\n// File: index.js\nimport header from 'templates/header';\nexport default (config)=\u003e`\n\u003chtml\u003e\n    \u003cbody\u003e\n        ${ header(config) }\n        \n        \u003c!-- more content here --\u003e\n    \u003c/body\u003e\n\u003c/html\u003e\n`\n// endfile\n```\n\n## Complex logic\nIf your templates start to get complicated you can always fall back to javascript to handle complex bits - so long as the default export returns a string.\n```js\nimport item_card from 'templates/item_card.js';\nexport default (config)=\u003e {\n  let x = 0;\n  let cards = config['items'].map((item)=\u003e{\n    return item_card(item, x++);\n  });\n  return `\n     \u003chtml\u003e\n         \u003cbody\u003e\n             ${ cards.join('') }\n             \n             \u003c!-- more content here --\u003e\n         \u003c/body\u003e\n     \u003c/html\u003e\n  `\n}\n```\n\n## Injecting environment variables\nOccasionally, it's helpful to inject variables at build-time. As of 0.2.0, any key=value pairs after `--` will be processed as additional config properties and can even override existing values in the config file.\n\n```js\n//myPage.js\nexport default ({env=\"prod\"})=\u003e`\n\u003chtml\u003e\n\u003chead\u003e ... \u003c/head\u003e\n\u003cbody\u003e\n\n...\n\n${/* Use env to switch between minified and unminified javascript files */ '' }\n${env === 'prod' ? `\n  \u003cscript src=\"dist/main.min.js\"\u003e\u003c/script\u003e\n` : `\n  \u003cscript type=\"module\" src=\"main.js\"\u003e\u003c/script\u003e\n`}\n\n\u003c/body\u003e\n\u003c/html\u003e\n`;\n\n```\n\n`template-literals --config \"config.yml\" --outdir ./ ./src/myPage.js -- env=dev`\n\n### A big stick \nThese overrides have a couple super powers. Take the following config:\n\n```json5\n{\n  \"projects\": [\n    {\n      \"title\": \"My Project\",\n      \"figures\": {\n        \"sales_6mo\": \"/images/sales.png\",\n        \"sales_3mo\": \"/images/sales2.png\"\n      }\n    },\n    // ...\n  ],\n  // ...\n}\n```\n\nNow imagine you need to override the project title. By specifying a key with **dot-notation** you can change properties deep in your config:\n\n`template-literals --config \"config.yml\" --outdir ./ ./src/myPage.js -- projects.0.title=\"The Best Project\"`\n\nAnd to take things a step further, you can completely override `projects.0.figures` with a new object by passing **JSON as a value**:\n\n`template-literals --config \"config.yml\" --outdir ./ ./src/myPage.js -- projects.0.title=\"The Best Project\" projects.0.figures='{\"sales_1mo\":\"/images/sales_1mo.png\",\"sales_3mo\":\"/images/sales_3mo.png\"}'`\n\nFinal result:\n```json5\n{\n  \"projects\": [\n    {\n      \"title\": \"My Best Project\",\n      \"figures\": {\n        \"sales_1mo\":\"/images/sales_1mo.png\",\n        \"sales_3mo\":\"/images/sales_3mo.png\",\n      }\n    },\n    // ...\n  ],\n  // ...\n}\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwilson8767%2Ftemplate-literals-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwilson8767%2Ftemplate-literals-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwilson8767%2Ftemplate-literals-cli/lists"}