0.0.1 • Published 14 years ago
stripper v0.0.1
Stripper
Strips formatted comments to enable and disable blocks of code.
Installing
$ npm i stripperUsage
This software is meant primarily as a build tool. A basic syntax and simple preprocessor are supported.
Basic Usage
var stripper = require('stripper');
var stripped = stripper.strip('lib.js');Input
// start
do something
// STRIP
strip it
// END_STRIP
// endOutput
// start
do something
// endTypical Options
var stripper = require('stripper');
var stripped = stripper.strip({path: 'lib.js', inclusive: false, startToken: 'DEBUG', endToken: 'END'});Input
start
/* DEBUG
debug
END */
endOutput
start
debug
endPreprocessor
var stripper = require('stripper');
var stripped = stripper.strip({path: 'lib.js', preprocess: {FOO: true});Input
start
// #ifdef FOO
foo
// #else
nofoo
// #endifdef
end
// #ifndef BAR
nobar
// #endifndefOutput
start
foo
nobar
endMore
See the test folder and code for more usage information.
License
MIT
0.0.1
14 years ago