Nearly Perfect Mediocracy
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    console-patchpublic

    console-patch

    monkeypatches all console.* methods and lets you intercept the arguments. does not break the console methods, they will still work, you just get a copy of their arguments whenever they are called

    NPM

    installation

    npm install console-patch --save

    usage

    use in server or browser with browserify

    var patch = require('console-patch')
     
    var intercepted = []
     
    console.log('hi')
     
    patch(function onConsoleCall(args) {
      intercepted.push(args)
    })
     
    console.log('bye')
     
    // intercepted === {method: 'log', arguments: ['bye']} 

    in the above example both console.log still print to the normal console

    install

    npm i console-patch

    Downloadslast 7 days

    1

    version

    1.0.0

    license

    BSD

    repository

    github.com

    last publish

    collaborators

    • avatar