Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alosaur/mustache
Template render
https://github.com/alosaur/mustache
Last synced: 24 days ago
JSON representation
Template render
- Host: GitHub
- URL: https://github.com/alosaur/mustache
- Owner: alosaur
- License: mit
- Created: 2020-05-01T19:35:28.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-14T17:15:02.000Z (almost 3 years ago)
- Last Synced: 2024-10-29T16:11:07.913Z (about 2 months ago)
- Language: JavaScript
- Size: 24.4 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-deno - mustache - Mustache template engine for deno (Modules / Template engine)
README
## Mustache template render
[mustache.js](https://github.com/janl/mustache.js)
![test](https://github.com/alosaur/mustache/workflows/test/badge.svg)
### How to use renderer in Alosaur
```ts
import { renderFile } from 'https://deno.land/x/mustache/mod.ts';app.useViewRender({
type: 'mustache',
basePath: `${Deno.cwd()}/views/`, // path to folder views
getBody: (path: string, model: Object, config: ViewRenderConfig) =>
renderFile(normalize(`${config.basePath}${path}.html`), model),
});
```