/inhtml

Lightweight html generator to create sever-side-rendering pages with ease

Primary LanguageJavaScript

inHTML

npm npm bundle size npm NPM

inHTML is a light-weight HTML templating engine written in NodeJS. It is used to pre-render saved HTML files.

Installation

Use the package manager npm to install inHTML.

npm install inhtml

Usage

<!-- CONSIDERING THAT 'welcome.html' PAGE LOOKS LIKE THIS -->
<h1>Hi, <a href="#{link}">#{name}</a></h1>
const inHTML = require('inhtml');

const welcomePage = inHTML('./welcome.html');


const finalHTML = welcomePage.render({link:'https://github.com/rohitnairtech', name:'Rohit Nair'});

console.log(finalHTML); // returns '<h1>Hi, <a href="https://github.com/rohitnairtech">Rohit Nair</a></h1>'

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

ISC