Lara Template Deno
lara deno template is a template compiler inspired by the Blade Template compiler of the Laravel Framework for the Deno runtime environment.
Features
- Render
- Compiler
- Transpile
- Minify
- Formatter
- Custom Directives
- Global Scoped
- Preload Code
- Http Response
- Temporal Data
Overview
Contents
Prerequisites
The following prerequisites are only necessary for the installation of Lara Template Deno
- Deno@^1.32.1
Prerequisites Installation (Click to show)
- to install deno you need to follow the steps in the following link Deno Install.
Installation
In order to use the lara template deno follow the following code as an example
/**
* you can import the library using this form
*/
import { LaraDenoTemplate } from "https://deno.land/x/lara_deno_template@v1.0.0/mod.ts"
// or
import * as laraDenoTemplate from "https://deno.land/x/lara_deno_template@v1.0.0/mod.ts";
Introduction
You can use LaraTemplateDeno to render your templates simply. As in the following example
// imports the class LaraTemplateDeno
import { LaraDenoTemplate } from "https://deno.land/x/lara_deno_template@v1.0.0/mod.ts"
// initializes the class
const denoTemplate = new LaraDenoTemplate();
// creates a variable containing the text to render
const render = `
personal information:
name {{ $name }}
age {{ $age }}
`;
// pass it the variable containing the text to be rendered and an object with the properties and methods to be interpreted in the template
const result = await denoTemplate.render(render, {
name: "jack",
age: 27
});
// prints the result
console.log(result)
/**
* Output
* personal information:
* name jack
* age 27
*/
Examples
Used By
This project is used by the following companies:
Fork the repository, append your company’s name with the URL in above format inside the README.md file and make a PR! or create a GitHub issue mentioning (Site’s name & domain).
Feedback
Create an issue on github repo. and mention the details there.
Contributing
All contributions are super welcomed!
License
Lara Template Deno is provided under MIT License