0.0.7 • Published 8 years ago

html-requirer v0.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
8 years ago

html-requirer Build Status

Allows you to require html into your js as a string for use in templates. Uses readFileSync under the hood, so works best in situations performance is not so important. i.e. build scripts.

Install

npm install html-requirer

Usage

const requireHtml = require('html-requirer');
const header = requireHtml('../../templates/header.html');

const html = `
  <!doctype html>
  <html lang="en">
  <head>
    <meta charset="utf-8">
  </head>
  <body>
    ${header}
    <section>
      <p>other stuff</p>
    </section>
  </body>
  </html>
`;
0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago