This package has been deprecated

Author message:

jade-strip-comments will be unpublished soon, please use pug-strip-comments

jade-strip-comments

1.0.0 • Public • Published

jade-strip-comments

Strips comments from Jade token stream

Build Status Dependency Status NPM version

Installation

npm install jade-strip-comments

Usage

var lex = require('jade-strip-comments');
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

/jade-strip-comments/

    Package Sidebar

    Install

    npm i jade-strip-comments

    Weekly Downloads

    8

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • alubbe
    • bloodyowl
    • forbeslindesay
    • jbnicolai
    • timothygu