⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.1
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
invoice
/
node_modules
/
pug-strip-comments
/
View File Name :
README.md
# 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