{"id":24522019,"url":"https://github.com/lorefnon/edgejs-cli","last_synced_at":"2025-03-15T13:11:13.056Z","repository":{"id":263049586,"uuid":"889055423","full_name":"lorefnon/edgejs-cli","owner":"lorefnon","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-15T20:58:36.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-09T05:31:50.918Z","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/lorefnon.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":"2024-11-15T14:22:05.000Z","updated_at":"2024-11-15T20:58:39.000Z","dependencies_parsed_at":"2024-11-18T07:47:26.247Z","dependency_job_id":null,"html_url":"https://github.com/lorefnon/edgejs-cli","commit_stats":null,"previous_names":["lorefnon/edgejs-cli"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lorefnon%2Fedgejs-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lorefnon%2Fedgejs-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lorefnon%2Fedgejs-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lorefnon%2Fedgejs-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lorefnon","download_url":"https://codeload.github.com/lorefnon/edgejs-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243732300,"owners_count":20338839,"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":"2025-01-22T03:17:34.403Z","updated_at":"2025-03-15T13:11:13.038Z","avatar_url":"https://github.com/lorefnon.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# edgejs-cli\n\nMinimal CLI utility to generate files using edge.js templates\n\n## Usage\n\n```sh\npnpm i -g edgejs-cli\n# ^ Will add an edget utility to PATH\n\n# Render a single template\nedget -i templates/home.edge -o site\n# ^ Generates site/home.html by rendering home.edge\n\n# Pass data to templates through a JSON/YAML file\nedget -i templates/home.edge -o site -d data.json\n# ^ Same as above but home.edge can use any values defined in data.json\n\n# Render all templates within a directory (Files prefixed with . or _ are ignored)\nedget -i templates -o site -d data.json\n\n# Skip escaping if generating non-html content\nedget -i sql-templates -o sql --skipEscaping\n```\n\n## Advanced features\n\n### Multi-mode\n\nIt is not necessary that each input file generate exactly one input file, or that the output file name match input file name.\n\nWith multi-mode, we can render an output in the following format (inspired by Vue SFC):\n\n```xml\n\u003c!-- post.multi.edge --\u003e\n\u003cfile path=\"post/summary.html\"\u003e\nHere is some summary content\n\u003c/file\u003e\n\u003cfile path=\"post/details.html\"\u003e\nHere are some details\n\u003c/file\u003e\n```\n\nNote that the file extension needs to be `.multi.edge`.\n\nThis will generate two files `\u003cout-dir\u003e/post/summary.html` with content `Here is some summary content` and `\u003cout-dir\u003e/post.details.html` with content `Here are some details`.\n\nXML parsing happens after the edge template has been rendered,\nso not only can the content inside `\u003cfile\u003e` tags be dynamic, we can also dynamically add `\u003cfile\u003e` tags too.\n\nSo the following is legal:\n\n```xml\n@each (post in posts)\n\u003cfile path=\"post/{{post.slug}}/summary.html\"\u003e\n{{post.title}} - by {{post.author}}\n\u003c/file\u003e\n\u003cfile path=\"post/{{post.slug}}/details.html\"\u003e\n{{post.body}}\n\u003c/file\u003e\n@end\n```\n\n(final output must be valid XML)\n\nIt is possible to dedent and trim the content through attributes in the file tag:\n\n```xml\n\u003cfile path=\"post/summary.html\" trim=\"true\" dedent=\"true\"\u003e\n\u003c/file\u003e\n```\n\n## Use cases\n\nThis is intended to be a minimal utility that simplifies tasks like below for JS/TS developers comfortable with CLI:\n\n- Building static sites\n- Knowledge-graphs\n- Code generation\n- Using edge.js from other languages\n\n## Motivations\n\nIf you don't care about cross-language support, edgejs is easier than Handlebars/mustache/liquid etc.\nbecause the embedded expressions are plain JS - so there is less need to learn custom syntax specific\nto the templating language, and we also have first class support for async.\n\nAlso, unlike JSX based solutions, it is more versatile because it is not limited to HTML\n\n---\n\n:warning: This project has nothing to do with Microsoft edge browser.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Florefnon%2Fedgejs-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Florefnon%2Fedgejs-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Florefnon%2Fedgejs-cli/lists"}