🚀 Launch Week Day 4:Introducing the Alert Details Page: A Better Way to Explore Alerts.Learn More →
Socket
Book a DemoInstallSign in
Socket

document-watch

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

document-watch

watch for atomic changes in a document

latest
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

Document Watch

Document is a little module that enables you to do one thing, watch for changes in documents in an atomic way.
It's available through npm:

npm install document-watch

And it's super easy to use:

var watch = require('document-watch');

var doc = {hello:'world', count:0};

var unwatch = watch(doc, function(changes) {
	console.log(changes);
});

doc.hello = 'other world';
doc.count++;
doc.count++;

// on nextTick the following gets printed:

{hello:'other world', count:2}

Keywords

json

FAQs

Package last updated on 06 Nov 2011

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