Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
lib/ | 25-Sep-2023 | - | 155 | 142 | ||
node_modules/ | 25-Sep-2023 | - | 32,608 | 25,565 | ||
CHANGELOG.md | D | 24-Sep-2023 | 498 | 35 | 18 | |
LICENSE | D | 24-Sep-2023 | 1 KiB | 19 | 16 | |
README.md | D | 24-Sep-2023 | 1.5 KiB | 43 | 24 | |
index.js | D | 24-Sep-2023 | 120 | 4 | 3 | |
package.json | D | 24-Sep-2023 | 1 KiB | 42 | 41 |
README.md
1# pug-filters 2 3Code for processing filters in pug templates 4 5[](https://travis-ci.org/pugjs/pug-filters) 6[](https://david-dm.org/pugjs/pug?path=packages/pug-filters) 7[](https://david-dm.org/pugjs/pug?path=packages/pug-filters&type=dev) 8[](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