{"id":16485812,"url":"https://github.com/creeperyang/sugar-template","last_synced_at":"2025-07-29T03:03:11.644Z","repository":{"id":57374155,"uuid":"61353969","full_name":"creeperyang/sugar-template","owner":"creeperyang","description":"JavaScript template based on `mustache`","archived":false,"fork":false,"pushed_at":"2017-04-07T11:27:00.000Z","size":63,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-09T08:57:02.304Z","etag":null,"topics":["mustache","mustache-templates","template","template-engine"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/creeperyang.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","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":"2016-06-17T07:20:57.000Z","updated_at":"2017-04-07T08:56:47.000Z","dependencies_parsed_at":"2022-09-17T16:00:50.380Z","dependency_job_id":null,"html_url":"https://github.com/creeperyang/sugar-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/creeperyang/sugar-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creeperyang%2Fsugar-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creeperyang%2Fsugar-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creeperyang%2Fsugar-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creeperyang%2Fsugar-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/creeperyang","download_url":"https://codeload.github.com/creeperyang/sugar-template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creeperyang%2Fsugar-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267621570,"owners_count":24116899,"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-07-29T02:00:12.549Z","response_time":2574,"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":["mustache","mustache-templates","template","template-engine"],"created_at":"2024-10-11T13:27:21.516Z","updated_at":"2025-07-29T03:03:11.611Z","avatar_url":"https://github.com/creeperyang.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sugar-template[![Build Status](https://travis-ci.org/creeperyang/sugar-template.svg?branch=master)](https://travis-ci.org/creeperyang/sugar-template)\n\n\u003e A simple template engine based on `mustache.js`.\n\n## Install\n\n[![NPM](https://nodei.co/npm/sugar-template.png)](https://nodei.co/npm/sugar-template/)\n\n## Usage\n\n```js\nconst sugar = require('sugar-template')\n\nsugar.render(`{{title | uppercase}}`, { title: 'test' }) // --\u003e 'TEST'\nsugar.render(`{{#each user}}{{.}} {{/each}}`, {\n    user: {\n        name: 'Mike',\n        age: 18,\n        gender: 'M'\n    }\n})\n// --\u003e Mike 18 M\n```\n\n### Syntax\n\n1. Expression, `{{varialbe}}`, starts with `{{` and ends with `}}`.\n\n2. HTML escaping. Normal expression will be automatically escaped. So, use `{{{varialbe}}}` if you don't wanna escaping.\n\n3. Helpers. Almost like `handlebars`, `{{#helper context}} {{/helper}}`.\n\n4. Inline helpers. `{{helper context}}`.\n\n5. Filters. `{{context | filter}}`.\n\n6. Ignore Compile. `{{=text=}}`, `text` here will output without any change.\n\n### API\n\n#### `sugar.render(String: template, Object: data)`\n\nRender template to string.\n\n#### `sugar.parse(String: template)`\n\nParse template to AST.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreeperyang%2Fsugar-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreeperyang%2Fsugar-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreeperyang%2Fsugar-template/lists"}