{"id":19472013,"url":"https://github.com/pedsmoreira/casex-template","last_synced_at":"2025-07-15T05:34:31.469Z","repository":{"id":65448231,"uuid":"162516817","full_name":"pedsmoreira/casex-template","owner":"pedsmoreira","description":"Simple, self expressive template engine for scaffolding files based on casex","archived":false,"fork":false,"pushed_at":"2024-01-13T21:57:48.000Z","size":391,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-22T21:42:51.288Z","etag":null,"topics":["javascript","nodejs","templating-engine","typescript"],"latest_commit_sha":null,"homepage":"https://dxtr.dev/casex-template","language":"TypeScript","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/pedsmoreira.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2018-12-20T02:39:46.000Z","updated_at":"2024-01-13T11:47:43.000Z","dependencies_parsed_at":"2024-01-14T05:20:45.892Z","dependency_job_id":"8eeb75ce-5480-4db3-9bbc-a2d5e43f41d9","html_url":"https://github.com/pedsmoreira/casex-template","commit_stats":null,"previous_names":["pedsmoreira/battle-casex","pedsmoreira/casex-template","dxtr-dot-dev/casex-template"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedsmoreira%2Fcasex-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedsmoreira%2Fcasex-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedsmoreira%2Fcasex-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedsmoreira%2Fcasex-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pedsmoreira","download_url":"https://codeload.github.com/pedsmoreira/casex-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240692147,"owners_count":19842193,"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":["javascript","nodejs","templating-engine","typescript"],"created_at":"2024-11-10T19:11:47.607Z","updated_at":"2025-02-25T15:23:39.740Z","avatar_url":"https://github.com/pedsmoreira.png","language":"TypeScript","readme":"# casex-template\n\nSimple, self expressive template engine for scaffolding files based on [casex](https://github.com/pedsmoreira/casex)\n\n## Introduction\n\n_casex-template_ is a simple template engine that applies the [casex](https://github.com/pedsmoreira/casex) pattern to\nall\noccurrences in a template.\n\nOften creating templates feels tedious and time consuming, I wanted to create an engine that lets someone pretty much\ncopy an example file, replace a few words and you should be good to go.\n\n## Install\n\n```zsh\nnpm install --save casex-template\n```\n\n## Usage\n\n```ts\nimport {casexTemplate} from 'casex-template';\n\nconst text = \"const __na_me__ = () =\u003e '#TODO: Implement Na Me'\";\ncasexTemplate({text, name: 'cool component'})\n```\n\n# How it works\n\nAs the name suggests project uses [casex](https://github.com/pedsmoreira/casex), an open source library designed to be\nan `All in one function for transforming word casings`.\n\nWhile `casex` is design to apply a pattern for a specific string, _casex-template_ focuses on getting a template,\nfinding\nall occurrences of `__name__` and replacing them with the corresponding value.\n\nHere are a few examples of how it works, considering you're using the name `John Doe`:\n\n- `__name__`: johndoe\n- `__naMe__`: johnDoe\n- `__NaMe__`: JohnDoe\n- `__na-me__`: john-doe\n- `__na me__`: john doe\n\n## Pluralization and singularization\n\n_casex-template_ provides pluralization and singularization out of the box\nwith [pluralize](https://github.com/blakeembrey/pluralize).\n\nTo use this feature, instead of `__name__`, use `_name_`, with one underscore. Here are a few examples of how it works:\n\n- Regulars: `user`\n    - `_name_`: user\n    - `_name_s`: users\n- Irregulars: `person`\n    - `_name_`: person\n    - `_name_s`: people\n- Composed names: `user name`\n    - `_na me_`: user name\n    - `_na me_s`: user names\n- Names in the plural: `users`\n    - `_na me_`: user\n    - `_na me_s`: users\n\n## License\n\n_casex-template_ is open-sourced software licensed under the [MIT License](./LICENSE.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedsmoreira%2Fcasex-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpedsmoreira%2Fcasex-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedsmoreira%2Fcasex-template/lists"}