New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

html-requirer

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-requirer

require html files to use as sub templates

latest
npmnpm
Version
0.0.7
Version published
Maintainers
1
Created
Source

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>
`;

Keywords

require

FAQs

Package last updated on 25 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts