{"id":13566883,"url":"https://github.com/eeue56/elm-static-html-lib","last_synced_at":"2025-08-23T09:10:03.499Z","repository":{"id":57106393,"uuid":"98530983","full_name":"eeue56/elm-static-html-lib","owner":"eeue56","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-18T19:16:28.000Z","size":63,"stargazers_count":58,"open_issues_count":8,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-09T05:27:39.762Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eeue56.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":"2017-07-27T12:04:51.000Z","updated_at":"2025-03-11T13:28:29.000Z","dependencies_parsed_at":"2024-06-19T03:08:55.172Z","dependency_job_id":null,"html_url":"https://github.com/eeue56/elm-static-html-lib","commit_stats":{"total_commits":37,"total_committers":5,"mean_commits":7.4,"dds":"0.18918918918918914","last_synced_commit":"4f4456a3cffaccbfc685194fe87623c20e493669"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/eeue56/elm-static-html-lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eeue56%2Felm-static-html-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eeue56%2Felm-static-html-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eeue56%2Felm-static-html-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eeue56%2Felm-static-html-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eeue56","download_url":"https://codeload.github.com/eeue56/elm-static-html-lib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eeue56%2Felm-static-html-lib/sbom","scorecard":{"id":368051,"data":{"date":"2025-08-11","repo":{"name":"github.com/eeue56/elm-static-html-lib","commit":"4f4456a3cffaccbfc685194fe87623c20e493669"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.9,"checks":[{"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":"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":"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":"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":"Code-Review","score":1,"reason":"Found 3/25 approved changesets -- score normalized to 1","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":"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" 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":"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":0,"reason":"13 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9","Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","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 8 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-18T12:20:16.698Z","repository_id":57106393,"created_at":"2025-08-18T12:20:16.698Z","updated_at":"2025-08-18T12:20:16.698Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271746301,"owners_count":24813557,"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-08-23T02:00:09.327Z","response_time":69,"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":[],"created_at":"2024-08-01T13:02:18.793Z","updated_at":"2025-08-23T09:10:03.470Z","avatar_url":"https://github.com/eeue56.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# elm-static-html-lib\n\nGenerate static html by passing an optional json object to your Elm views.\n\nLibrary version of elm-static-html.\n\n## Install\n\n```\nnpm install --save elm-static-html-lib\n```\n\n## Usage\n\n### with an argument\n\nIn this example, we use `decodeModel` to turn the passed JSON into a model that our view can use.\n\n```javascript\n\nimport { elmStaticHtml } from \"elm-static-html-lib\";\n\n\nconst model = { name: \"Noah\", age : 24 };\nconst options = { model : model, decoder: \"MyModule.decodeModel\" };\n\nelmStaticHtml(\"/absolute/path/to/elm-package.json\", \"MyModule.view\", options)\n.then((generatedHtml) =\u003e {\n    fs.writeFileSync(\"output.html\", generatedHtml);\n});\n\n```\n\n### without an argument\n\nIn this case, our view has the type `Html msg`.\n\n```javascript\n\nimport { elmStaticHtml } from \"elm-static-html-lib\";\n\n\nconst options = { };\n\nelmStaticHtml(\"/absolute/path/to/elm-package.json\", \"MyModule.view\", options)\n.then((generatedHtml) =\u003e {\n    fs.writeFileSync(\"output.html\", generatedHtml);\n});\n\n```\n\n### With no indent\n\nIn order to truly match what Elm generates at runtime, you may not want to have spaces or indent inserted. You can do this by setting the `newLines` and `indent` options like so:\n\n```javascript\n\nimport { elmStaticHtml } from \"elm-static-html-lib\";\n\n\nconst model = { name: \"Noah\", age : 24 };\nconst options = { model : model, decoder: \"MyModule.decodeModel\", newLines: false, indent: 0 };\n\nelmStaticHtml(\"/absolute/path/to/elm-package.json\", \"MyModule.view\", options)\n.then((generatedHtml) =\u003e {\n    fs.writeFileSync(\"output.html\", generatedHtml);\n});\n\n```\n\n## multiple at once\n\nWhen you want to render many views - particularly when they share dependencies - it is faster to use the `multiple` function.\n\n```javascript\nconst configs = [ \n    { viewFunction: \"MyModule.view\", model, decoder: \"MyModule.decodeModel\", fileOutputName: \"grouped1.html\" }, \n    { viewFunction: \"MyModule.lazyView\", model, decoder: \"MyModule.decodeModel\", fileOutputName: \"grouped2.html\" }, \n    ];\n\nelmStaticHtml.multiple(\"/absolute/path/to/elm-package.json\", configs)\n.then((generatedHtmls) =\u003e {\n    generatedHtmls\n        .map((output) =\u003e fs.writeFileSync(output.fileOutputName, output.generatedHtml));\n});\n```\n\n\n### API description\n\n```js\nelmStaticHtml(packagePath, viewFunction, options)\n```\n\n- **packagePath** *(String)*: An absolute path to the `elm-package.json` of your project.\n- **viewFunction** *(String)*: [Qualified name](https://guide.elm-lang.org/reuse/modules.html) to the view function. Format `\u003cModuleName\u003e.\u003cfunctionName\u003e`\n- **options** *(object)*: A map of options. Can be either empty or contain a model and a qualified decoder name. See above for usage details.\n\n```js\nelmStaticHtml.multiple(packagePath, configs)\n```\n\n- **packagePath** *(String)*: An absolute path to the `elm-package.json` of your project.\n- **configs** *ViewFunctionConfig[]*: An array of configurations, see below.\n- **alreadyRun?** *(Boolean)*: When true, doesn't generate boilerplate again. Useful if only your models have changed, and not your elm code.\n- **elmMakePath?** *(String)*: Specify the path to elm-make.\n- **installMethod** *(String)*: Specify a custom package installation command.\n\n**returns** *Output*: An object containing the generated html and the outputFileName.\n\n```typescript\nexport interface ViewFunctionConfig {\n    viewFunction: string;\n    fileOutputName: string;\n    model?: any;\n    decoder?: string;\n    indent?: number;\n    newLines?: boolean;\n}\n```\n\n- **viewFunction**: [Qualified name](https://guide.elm-lang.org/reuse/modules.html) to the view function. Format `\u003cModuleName\u003e.\u003cfunctionName\u003e`\n- **fileOutputName**: File name. This value is not touched and given back to `Output`, to make saving the generated html easier\n- **model?**: Optional object that is given as the model to your view function\n- **decoder?**: [Qualified name](https://guide.elm-lang.org/reuse/modules.html) to the decoder for `model`. Format `\u003cModuleName\u003e.\u003cdecoderName\u003e`\n- **indent?**: Optional formatting flag. Sets whether the generated html should be indented (default true)\n- **newLines?**: Optional formatting flag. Sets whether new tags should start on a new line when (default true)\n\n```typescript\nexport interface Output {\n    generatedHtml: string;\n    fileOutputName: string;\n}\n```\n\n- **generatedHtml**: The html that your view has produced\n- **fileOutputName**: A file name that is threaded through for convenience\n\n\n### More examples\n\n\nCheck out the [example](https://github.com/eeue56/elm-static-html-lib/tree/master/example) folder for a more in-depth example.\n\n\n## Production\n\nIf you are running this in production, you may want to only generate the boilerplate files once. You can do that by setting the option `alreadyRun` to true. When `alreadyRun` is true, the Elm app is only started -- no boilerplate is generated.\n\nYou may want to hide warnings, which you can do by setting `HIDE_WARNINGS=true` in your env.\n\n\n## Changelog\n\n\n### 0.1.0\n\n- elmStaticHtml now exposes two functions with no default, e.g `import { elmStaticHtml, multiple }`\n- `multiple` added to provide a way to compile multiple views in a single pass","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feeue56%2Felm-static-html-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feeue56%2Felm-static-html-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feeue56%2Felm-static-html-lib/lists"}