1.0.0 • Published 7 years ago

js-groomer v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

Usage:

Remove just a comment

const groomer = require('js-groomer');
const cleaned = groomer.handleFile(myFileInput, function(comment) {
    if (comment === '// REMOVEME')
        return groomer.RemoveOptions.REMOVE_COMMENT;
});

Remove a block of code after a comment

const groomer = require('js-groomer');
const cleaned = groomer.handleFile(myFileInput, function(comment) {
    if (comment === '// REMOVEME')
        return groomer.RemoveOptions.REMOVE_CODE;
});

Replace a comment

const groomer = require('js-groomer');
const cleaned = groomer.handleFile(myFileInput, function(comment) {
    if (comment === '// REMOVEME') {
        return {
            action: groomer.RemoveOptions.REMOVE_COMMENT,
            data: 'foobar'
        };
    }
});