Socket
Book a DemoInstallSign in
Socket

call-log

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

call-log

Instrument an object or class so that anytime one of its method is invoked it gets logged to the console.

latest
Source
npmnpm
Version
1.0.7
Version published
Maintainers
1
Created
Source

call-log travis npm downloads javascript style guide

Instrument a JavaScript class (or object) so that anytime a method function is called it gets logged to the console.

cat

install

npm install call-log

This module works in the browser with browserify.

Note: If you're NOT using browserify, then use the included standalone file call-log.min.js. This exports a CallLog constructor on window.

usage

var callLog = require('call-log')

function Cat () {}
Cat.prototype.meow = function (sound) { return sound }

// Add instrumentation to Cat
callLog(Cat)

// Use the cat
var cat = new Cat()
cat.meow()
cat.meow('MEOAAAAWWW!')

// Prints:
// "called meow"
// "called meow", "MEOAAAAWWW!"

license

MIT. Copyright (c) Feross Aboukhadijeh

Keywords

call log

FAQs

Package last updated on 27 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts