eot-js

1.0.4 • Public • Published

EOT-JS

Javascript heredoc syntax for create a multiline string

Install

NPM npm install eot-js --save

Bower bower install eot-js --save

Download here

How to use

var eot = require('eot-js');
var template = eot(function() {
    /*EOT
    
// your string here
    
    EOT*/
));
 
console.log(template);

Template engine integration

EOT-JS support template engine

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

Contributor

Dida Nurwanda

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.4
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.4
    2
  • 1.0.2
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i eot-js

Weekly Downloads

1

Version

1.0.4

License

MIT

Last publish

Collaborators

  • didanurwanda