cove-compiler

1.0.1 • Public • Published

cove

Simplify HTML then recompile it later.

Cove takes a sequence (like "{{hello}}") and evaluates the code inside it. You can get a variable from it, or evaluate JavaScript code. Once compiled, it replaces all of the sequences found with its returned result.

Usage

cove main.cov

main.cov (before):

<script>
window.world = "world"
</script>
<h1> Hello {{world}}! </h1>

main.cov (after):

<script>
window.world = "world"
</script>
<h1> Hello world! </h1>

Examples

Math

<h1> {{ var equation = "5 + 5"; eval(equation) == 10 ? equation.toString() + " is 10" : equation.toString() + " is not 10" }} </h1>

Result:

<h1> 5 + 5 is 10 </h1>

Readme

Keywords

none

Package Sidebar

Install

npm i cove-compiler

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

2.4 kB

Total Files

3

Last publish

Collaborators

  • diegab