Skip to content
Strip JavaScript nodes (like console.* or if(...) ) out of your source code
JavaScript
Pull request Compare This branch is 3 commits ahead of jsoverson:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
bin
tasks
test
.gitignore
.jshintrc
.npmignore
Gruntfile.js
History.md
LICENSE-MIT
README.md
package.json

README.md

grunt-strip-nodes

Strip JavaScript nodes (like console.* or if(...) ) out of your source code. Forked from: Jarrod Overson

Getting Started

Install this grunt plugin next to your project's Gruntfile with: npm install grunt-strip

Then add this line to your project's Gruntfile:

grunt.loadNpmTasks('grunt-strip-modules');

Configuration

Configuration - strip all iog, console.log statements and all if-code-blocks starting with: "if (rtlviewmode==='test') {""

strip : {
  main : {
    nodes : [
      'iog', 
      'console.log',
      { //esprima parser:
          type:'IfStatement',
          operator:'===',
          leftType:'Identifier',
          leftName:'rtlviewmode',
          rightType:'Literal',
          rightValue:'test',
          replaceWith:'/* removed by strip */'
      }          
    ],
    src : 'test/fixtures/all_api_methods.js',
    dest : 'tmp/all_api_methods.js'
  }
}

Release History

  • 0.1.2 nodeunit tests fixed
  • 0.1.1 forked

License

Copyright (c) 2013 WillemHein Triemstra
Licensed under the MIT license.

Something went wrong with that request. Please try again.