Javascript heredoc syntax for create a multiline string
npm install eot-jsNPM npm install eot-js --save
Bower bower install eot-js --save
Download here
``javascript
var eot = require('eot-js');
var template = eot(function() {
/*EOT
// your string here
EOT*/
));
console.log(template);
`
* Mustache
* Handlebars
* EJS <% Embedded JavaScript %>
* Underscore
* Parser
`javascript
var eot = require('eot-js');
var engine = require('your-template-engine');
var config = {
templateEngine: 'engine-name',
engine: engine, // context
};
var data = {
name: 'Dida Nurwanda'
}
var template = eot(function() {
/*EOT
Hallo {name}
EOT*/
}, config, data);
// output
Hallo Dida Nurwanda
`
##### config api
- templateEngine - template engine name
- engine - template engine context
- engineOptions - template engine options
- format - output format text or javascript`
- trim - trim output
* http://www.didanurwanda.com
* Blog
* Github Repository
* NPM
* Twitter