npm.io
0.1.8 • Published 5 years ago

esi-processor

Licence
MIT
Version
0.1.8
Deps
6
Size
38 kB
Vulns
23
Weekly
0

esi-processor

node npm

A processor for processing ESI tags in html documents. Currently supporting esi:include, esi:remove, esi:comment, <!--esi -->, esi:choose and esi:vars.

Installation

npm install esi-processor

Usage

const esi = require('esi-processor').ESI;

const processed = await esi(html, [options]);

Options

You can use the following options:

BaseUrl

Add a base url to be used on relative esi:includes

Headers

Add custom HTTP headers for remote esi:includes e.g. { 'X-Custom-Header': 'x-custom-value' }

IgnoreEsiChooseTags

Ignore the esi:choose tags, only returning a comment

XmlMode

Use xmlMode (defaults to true). This option is passed to htmlparser2.

Verbose

Print extended log to the console.

Keywords