mirror of
https://github.com/fooflington/selfdefined.git
synced 2025-06-12 13:41:40 +00:00
update
This commit is contained in:
46
node_modules/pug-strip-comments/README.md
generated
vendored
Normal file
46
node_modules/pug-strip-comments/README.md
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
# pug-strip-comments
|
||||
|
||||
Strips comments from Pug token stream
|
||||
|
||||
[](https://travis-ci.org/pugjs/pug-strip-comments)
|
||||
[](https://david-dm.org/pugjs/pug?path=packages/pug-strip-comments)
|
||||
[](https://david-dm.org/pugjs/pug?path=packages/pug-strip-comments&type=dev)
|
||||
[](https://www.npmjs.org/package/pug-strip-comments)
|
||||
|
||||
## Installation
|
||||
|
||||
npm install pug-strip-comments
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var lex = require('pug-lexer');
|
||||
var stripComments = require('pug-strip-comments');
|
||||
|
||||
var tokens = lex('//- unbuffered\n// buffered');
|
||||
// [ { type: 'comment', line: 1, val: ' unbuffered', buffer: false },
|
||||
// { type: 'newline', line: 2 },
|
||||
// { type: 'comment', line: 2, val: ' buffered', buffer: true },
|
||||
// { type: 'eos', line: 2 } ]
|
||||
|
||||
// Only strip unbuffered comments (default)
|
||||
stripComments(tokens, { filename: 'pug' });
|
||||
// [ { type: 'newline', line: 2 },
|
||||
// { type: 'comment', line: 2, val: ' buffered', buffer: true },
|
||||
// { type: 'eos', line: 2 } ]
|
||||
|
||||
// Only strip buffered comments (when you want to play a joke on your coworkers)
|
||||
stripComments(tokens, { filename: 'pug', stripUnbuffered: false, stripBuffered: true });
|
||||
// [ { type: 'comment', line: 1, val: ' unbuffered', buffer: false },
|
||||
// { type: 'newline', line: 2 },
|
||||
// { type: 'eos', line: 2 } ]
|
||||
|
||||
// Strip both (if you want Pug VERY clean)
|
||||
stripComments(tokens, { filename: 'pug', stripBuffered: true });
|
||||
// [ { type: 'newline', line: 2 },
|
||||
// { type: 'eos', line: 2 } ]
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
Reference in New Issue
Block a user