New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

object-watcher

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-watcher

Plugin that allows you to watch for changes in a javacript object

1.0.2
latest
Source
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

##ObjectWatcher

A super simple package to allow you to set watchers/listeners on your javascript variables.

Useful mostly for debugging when you aren't sure where a variable is being set/modified.

Just slap a watcher on it:

var watch = require(object-watcher).watch;

var data = {
     quantity: 0
     , products:  []
}
, watcher = function(propertyName, oldValue, newValue){ 
	console.log("Variable Changed!");
};

watch(data, 'quantity', watcher);
watch(data, 'products', watcher);

data.quantity = 8
// Variable Changed!

Keywords

watch

FAQs

Package last updated on 06 Feb 2015

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