Package Exports
- pug-strip-comments
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pug-strip-comments) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
jade-strip-comments
Strips comments from Jade token stream
Installation
npm install jade-strip-commentsUsage
var lex = require('jade-lexer');
var stripComments = require('jade-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: 'jade' });
// [ { 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: 'jade', 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 Jade VERY clean)
stripComments(tokens, { filename: 'jade', stripBuffered: true });
// [ { type: 'newline', line: 2 },
// { type: 'eos', line: 2 } ]License
MIT