eft-parser

ef.js template parser

Usage no npm install needed!

<script type="module">
  import eftParser from 'https://cdn.skypack.dev/eft-parser';
</script>

README

eft-parser

GitHub license npm Build status

Parser for ef.js templates

Usage

ES6

import parseEft from 'eft-parser'
// use `const parseEft = require('eft-parser')` for node.js

const template = 'Your awesome template here'
const ast = parseEft(template)

Browser

<script src="dist/eft-parser.js"></script>
<script>
    var template = 'Your awesome template here'
    var ast = parseEft(template)
</script>

Note: ef.js has a builtin parser, but if you want a faster first render, parse the templates beforehand could be better.

Run a test

$ git clone https://github.com/ClassicOldSong/eft-parser.git
$ cd eft-parser
$ npm install
$ npm start

Then you can test it out in the opening browser window.

Build from source

$ git clone https://github.com/ClassicOldSong/eft-parser.git
$ cd eft-parser
$ npm install
$ npm run build

Then you can get the fresh-built ef.min.js at the dist folder.

Note: All debugging messages are disabled in the production version

License

MIT