waterpipe
TypeScript icon, indicating that this package has built-in type declarations

2.8.0 • Public • Published

Documentation

See documentation on our wiki.

Installation

The library is a UMD-module that support browsers, AMD and Node.js.

For simplest case in HTML, include using <script> tags:

<script type="text/javascript" src="waterpipe.js"></script>

Usage

waterpipe(str, data, [options])

waterpipe('The value is {{value}}.', { value: 1 }); // The value is 1.

Options

globals

Defines global variables readable in this evaluation. Variables declared here will override those in waterpipe.globals.

indent

Sets indentation of resulting HTML markup.

Each level of nested elements will be indented by the specfied number of spaces or the specific sequence of characters. If either 0 or an empty string is specified, indentation is turned off as if this option is absent.

indentPadding

Number of spaces or the specific sequence of characters that will be left padded to each line. This option is only effective if the indent option is present and not equal to 0 or an empty string.

noEncode

Suppress encoding reserved HTML characters, including ', ", &, < and >.

html

When set to false, all HTML features such as encoding reserved HTML characters, indentation, malformed tag and attribute completions will be turned off. Useful for templates that is not for generating HTML content. Default is true.

Readme

Keywords

Package Sidebar

Install

npm i waterpipe

Weekly Downloads

46

Version

2.8.0

License

MIT

Unpacked Size

274 kB

Total Files

14

Last publish

Collaborators

  • misonou