@hapify/ejs
TypeScript icon, indicating that this package has built-in type declarations

1.3.1 • Public • Published

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'

Readme

Keywords

Package Sidebar

Install

npm i @hapify/ejs

Weekly Downloads

36

Version

1.3.1

License

MIT

Unpacked Size

36.2 kB

Total Files

12

Last publish

Collaborators

  • edouarddemotes
  • dt-tractr