by Before Semicolon

PartialFile

PartialFile details
Details
name PartialFile
type class
arguments file absolute path, source directory, Element options
description A class representing a partial HTML file.

Constructor

The constructor takes a required absolute path to the file, an optional source directory absolute path and a Element option.

Properties

Inherits all properties from File

Methods

render
type: function : A method that when called will return a string representation of HTML compiled.

Usage Examples

const path = require("path");
const {PartialFile} = require("@beforesemicolon/html-plus");

const layout = new PartialFile(path.resolve(__dirname, '_layout.html'));

console.log(`${layout.file} content is ${project.render()}`);