pug-strip-comments
Strips comments from Pug token stream
Installation
npm install pug-strip-comments
Usage
var lex = ;var stripComments = ; var tokens = ;// [ { 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);// [ { 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);// [ { type: 'comment', line: 1, val: ' unbuffered', buffer: false },// { type: 'newline', line: 2 },// { type: 'eos', line: 2 } ] // Strip both (if you want Pug VERY clean);// [ { type: 'newline', line: 2 },// { type: 'eos', line: 2 } ]
License
MIT