{"id":14982453,"url":"https://github.com/betahuhn/ejs-serve","last_synced_at":"2025-10-29T15:30:26.051Z","repository":{"id":38094414,"uuid":"308764173","full_name":"BetaHuhn/ejs-serve","owner":"BetaHuhn","description":"🔨👀 Build, watch and serve your EJS templates in your browser.","archived":false,"fork":false,"pushed_at":"2023-02-27T12:59:02.000Z","size":605,"stargazers_count":2,"open_issues_count":9,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T01:51:16.706Z","etag":null,"topics":["build-tool","development","ejs","ejs-cli","ejs-template-engine","ejs-templates","http","reload","watch"],"latest_commit_sha":null,"homepage":"https://mxis.ch","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/BetaHuhn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"ko_fi":"betahuhn","github":"betahuhn"}},"created_at":"2020-10-30T23:20:17.000Z","updated_at":"2024-08-30T04:05:56.000Z","dependencies_parsed_at":"2023-02-16T07:15:22.731Z","dependency_job_id":null,"html_url":"https://github.com/BetaHuhn/ejs-serve","commit_stats":null,"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BetaHuhn%2Fejs-serve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BetaHuhn%2Fejs-serve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BetaHuhn%2Fejs-serve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BetaHuhn%2Fejs-serve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BetaHuhn","download_url":"https://codeload.github.com/BetaHuhn/ejs-serve/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238840720,"owners_count":19539601,"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":["build-tool","development","ejs","ejs-cli","ejs-template-engine","ejs-templates","http","reload","watch"],"created_at":"2024-09-24T14:05:26.636Z","updated_at":"2025-10-29T15:30:25.658Z","avatar_url":"https://github.com/BetaHuhn.png","language":"JavaScript","funding_links":["https://ko-fi.com/betahuhn","https://github.com/sponsors/betahuhn","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=394RTSBEEEFEE"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# ejs-serve\n\n[![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/BetaHuhn/ejs-serve/blob/master/LICENSE) [![npm](https://img.shields.io/npm/v/ejs-serve)](https://www.npmjs.com/package/ejs-serve)\n\nBuild, watch and serve your EJS templates in your browser.\n\n\u003c/div\u003e\n\n## 👋 Introduction\n\n[ejs-serve](https://github.com/BetaHuhn/ejs-serve) is a CLI tool for developing/working with EJS templates.\n\n- renders your EJS templates with data\n- serves the files to your browser\n- watches for file changes and reloads your browser automatically\n- no extra files in your working directory\n- also watches for changes in your data\n- can be used in conjunction with [mjml](#generate-email-with-mjml)\n\n## 🚀 Get started\n\nInstall [ejs-serve](https://github.com/BetaHuhn/ejs-serve) globally via npm:\n```shell\nnpm install ejs-serve -g\n```\n\nAfter that `ejs-serve` is ready to be used 🎉\n\n## 📚 Usage\n\n```shell\nUsage: ejs-serve -f \u003cfilename\u003e -d \u003cjson string|file\u003e -p \u003cport\u003e        \n\nBuild, watch and serve your EJS templates in your browser.\n\nOptions:\n  -f, --file \u003cpath\u003e           path to ejs file\n  -d, --data \u003cjson\u003e           JSON string or path to json file\n  -p, --port \u003cnumber\u003e         port on which to serve the file (default: 8080)\n  -e, --email [boolean]       render file with mjml (default: false)\n  -o, --open [local/network]  open file in browser automatically (default: false)\n  -v, --version               output the version number\n  -h, --help                  display help for command\n```\n\n## 🛠️ Examples\n\n### Render EJS template with data from JSON file and serve it\n\n```shell\nejs-serve -f index.ejs -d data.json\n```\n\n### Render EJS template with data from JSON string and serve it\n\n```shell\nejs-serve -f index.ejs -d '{\"message\":\"Hello World!\"}'\n```\n\n### Serve on custom port\n\n```shell\nejs-serve -f index.ejs -d data.json -p 3000\n```\n\n### Automatically open browser\n\n`ejs-serve` can automatically open the file in the browser. If you use `-o` it will open the file via its local address (localhost:port). You can use `-o network` to use the network address.\n\n```shell\nejs-serve -f index.ejs -d data.json -p 3000 -o\n```\n\n### Generate email with mjml\n\n`ejs-serve` can be used in conjunction with [mjml](https://github.com/mjmlio/mjml) to render your ejs file with data and generate a reponsive email. Use the `-e` option to enable this feature and it will run the rendered ejs file through mjml.\n\n```shell\nejs-serve -f index.ejs -d data.json -e\n```\n\n### Use it in another project\n\nIf you want to use `ejs-serve` for development in another project, add it to your dev dependencies:\n\n```shell\nnpm install ejs-serve --save-dev\n```\n\nAnd include this command in your `package.json`\n\n```json\n  \"scripts\": {\n    \"templates\": \"ejs-serve -f ./path/to/file.ejs -d '{\\\"message\\\":\\\"Hello!\\\"}'\"\n  },\n```\n\n## 📝 To do\n\nHere is what's currently planned for [ejs-serve](https://github.com/BetaHuhn/ejs-serve):\n\n- render multiple files/whole directory\n- render files and output them to directory\n\n## 💻 Development\n\nIssues and PRs are very welcome!\n\n- run `yarn lint` or `npm run lint` to use eslint.\n- run `yarn example` or `npm run example` to serve the example EJS file\n\nPlease check out the [contributing guide](CONTRIBUTING.md) before you start.\n\nThis project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). To see differences with previous versions refer to the [CHANGELOG](CHANGELOG.md).\n\n## ❔ About\n\nThis library was developed by me ([@betahuhn](https://github.com/BetaHuhn)) in my free time. If you want to support me:\n\n[![Donate via PayPal](https://img.shields.io/badge/paypal-donate-009cde.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=394RTSBEEEFEE)\n\n## License\n\nCopyright 2020 Maximilian Schiller\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbetahuhn%2Fejs-serve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbetahuhn%2Fejs-serve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbetahuhn%2Fejs-serve/lists"}