{"id":17797553,"url":"https://github.com/wolfadex/deno_elm_compiler","last_synced_at":"2025-03-17T04:31:38.991Z","repository":{"id":62421833,"uuid":"311495410","full_name":"wolfadex/deno_elm_compiler","owner":"wolfadex","description":"A Deno wrapper around the Elm compiler","archived":false,"fork":false,"pushed_at":"2020-11-11T01:56:46.000Z","size":8,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-27T17:44:19.504Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wolfadex.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":"2020-11-09T23:57:08.000Z","updated_at":"2023-08-29T03:04:14.000Z","dependencies_parsed_at":"2022-11-01T17:32:09.316Z","dependency_job_id":null,"html_url":"https://github.com/wolfadex/deno_elm_compiler","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfadex%2Fdeno_elm_compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfadex%2Fdeno_elm_compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfadex%2Fdeno_elm_compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfadex%2Fdeno_elm_compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wolfadex","download_url":"https://codeload.github.com/wolfadex/deno_elm_compiler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243841210,"owners_count":20356443,"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","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-27T11:56:19.647Z","updated_at":"2025-03-17T04:31:38.679Z","avatar_url":"https://github.com/wolfadex.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deno_elm_compiler\n\nA partial port of @rtfeldman's [node-elm-compiler](https://github.com/rtfeldman/node-elm-compiler) to Deno.\n\n| Supports              | node-elm-compiler                                                                           | deno-elm-compiler |\n| --------------------- | ------------------------------------------------------------------------------------------- | ----------------- |\n| compile               | ✅                                                                                          | ✅                |\n| compileSync           | ✅                                                                                          | ❌                |\n| compileWorker         | ✅                                                                                          | ❌                |\n| compileToString       | ✅                                                                                          | ✅                |\n| compileToStringSync   | ✅                                                                                          | ❌                |\n| compileToModule       | ❌                                                                                          | ✅                |\n| compileToModuleString | ❌                                                                                          | ✅                |\n| findAllDependencies   | ✅ imported from [find-elm-dependencies](https://github.com/NoRedInk/find-elm-dependencies) | ❌                |\n| \\_prepareProcessArgs  | ✅                                                                                          | ❌                |\n\n---\n\n## Usage\n\nGiven some Elm code like\n\n```Elm\nmodule Main exposing (main)\n\nimport Html\n\n\nmain =\n    Html.text \"Hello from Elm!\"\n```\n\nin a build file do\n\n```typescript\nimport { compileToModule } from \"https://deno.land/x/deno_elm_compiler@0.1.0/compiler.ts\";\n\nawait compileToModuleString(\"./src/Main.elm\", { output: \"./src/elm.js\" });\n```\n\nthen run your bulid script with Deno\n\n```\ndeno run --allow-env --allow-run --allow-write --allow-read build.ts\n```\n\n- `--allow-env` is required to pass in ENV variables to the Elm compiler\n- `--allow-run` is required to allow Deno to run the Elm compiler\n- `--allow-write` is required for writing a module and for compiling to a string\n- `--allow-read` is required for compiling to a string\n\nafter you can consume your Elm code like any of the following\n\n```javascript\nimport Elm from \"./src/elm.js\";\n\nElm.Main.init();\n\n//----------- OR ---------------\n\nimport { Main } from \"./src/elm.js\";\n\nMain.init({ node: document.getElementById(\"elm-root\") });\n```\n\nFor more details on Elm and Javascript interop, see [the Elm docs](https://guide.elm-lang.org/interop/).\n\n## Todo:\n\n- [ ] Add a cli wrapper so you can optionally do `deno-elm src/Main.elm --optimize --module --output=src/elm.js`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolfadex%2Fdeno_elm_compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwolfadex%2Fdeno_elm_compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolfadex%2Fdeno_elm_compiler/lists"}