1.3.1 • Published 1 year ago
@hapify/ejs v1.3.1
Hapify EJS
Description
This repository provides a secured sandbox to render unsafe EJS templates
Usage
Basic usage
import { HapifyEJS } from '@hapify/ejs';
const script = `hello <%= value %>`;
const result = new HapifyEJS().run(script, { value: 'world' }); // result = 'hello world'
Advanced usage
import { HapifyEJS } from '@hapify/ejs';
const script = `hello <%= value %>`;
const result = new HapifyEJS({
timeout: 200, // Maximum script execution time. Default to 5000ms.
}).run(script, { value: 'world' }); // result = 'hello world'