• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

lib/25-Sep-2023-155142

node_modules/25-Sep-2023-32,60825,565

CHANGELOG.mdD24-Sep-2023498 3518

LICENSED24-Sep-20231 KiB1916

README.mdD24-Sep-20231.5 KiB4324

index.jsD24-Sep-2023120 43

package.jsonD24-Sep-20231 KiB4241

README.md

1# pug-filters
2
3Code for processing filters in pug templates
4
5[![Build Status](https://img.shields.io/travis/pugjs/pug-filters/master.svg)](https://travis-ci.org/pugjs/pug-filters)
6[![Dependencies Status](https://david-dm.org/pugjs/pug/status.svg?path=packages/pug-filters)](https://david-dm.org/pugjs/pug?path=packages/pug-filters)
7[![DevDependencies Status](https://david-dm.org/pugjs/pug/dev-status.svg?path=packages/pug-filters)](https://david-dm.org/pugjs/pug?path=packages/pug-filters&type=dev)
8[![NPM version](https://img.shields.io/npm/v/pug-filters.svg)](https://www.npmjs.org/package/pug-filters)
9
10## Installation
11
12    npm install pug-filters
13
14## Usage
15
16```
17var filters = require('pug-filters');
18```
19
20### `filters.handleFilters(ast, filters)`
21
22Renders all `Filter` nodes in a Pug AST (`ast`), using user-specified filters (`filters`) or a JSTransformer.
23
24### `filters.runFilter(name, str[, options[, currentDirectory]])`
25
26Invokes filter through `jstransformer`.
27
28This is internally used in `filters.handleFilters`, and is a lower-level interface exclusively for invoking JSTransformer-based filters.
29
30`name` represents the name of the JSTransformer.
31
32`str` represents the string to render.
33
34`currentDirectory` is used when attempting to `require` the transformer module.
35
36`options` may contain the following properties:
37
38- `minify` (boolean): whether or not to attempt minifying the result from the transformer. If minification fails, the original result is returned.
39
40## License
41
42  MIT
43