remove-log

0.0.8 • Public • Published

remove-log

node module for removing console.* (log, warn, err etc...) calls from source code. input js code as string or path and output the code without console calls. this module uses falafel to walk the AST tree.

usage

const removeLogs = require("remove-logs");
removeLogs.removeFromPath("/somepath.js", (err, modifiedSrc) => {
    //modifiedSrc is the source code without console calls
});
 
removeLogs.removeFromString("var x = 1; console.log('test');", (err, modifiedSrc) => {
    //modifiedSrc is the source code without console calls
});

customization

if you wish to leave console calls in the output code leave a comment //include at the end of the console call. for example:

console.log("this line will be removed");
console.log("this line will not be removed"); //include

license

MIT

Readme

Keywords

Package Sidebar

Install

npm i remove-log

Weekly Downloads

11

Version

0.0.8

License

MIT

Unpacked Size

3.68 kB

Total Files

4

Last publish

Collaborators

  • aviv1ron1