npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

objectwatchers

v0.2.0

Published

Object value and prop change detection module * **Object, Array, Web Global value watcher**

Readme

objectwatchers

Object value and prop change detection module

  • Object, Array, Web Global value watcher

Install

  • npm install objectwarchers

Support features:

  • browser support(UMD module)
    /dist/lib.bundle.umd.js
  • typescript support
    lib.d.ts
  • nodejs support
    /dist/lib.bundle.prod.js
  • Watch object variable change
    • RXjs Subject Support
    • windows message Support
  • Watch object Propery(Key) change(added property notify)
    • RXjs Subject Support
    • windows message Support
  • Watch object Propery(Key) Delete
    • RXjs Subject Support
    • windows message Support
  • Watch Array variable change
    • RXjs Subject Support
    • windows message Support
  • Watch Array Sort(Order) change
    • RXjs Subject Support
    • windows message Support

dependency:

  • rxjs

APIs

ObjectWatcher

  • Object and Array Watcher module

  • Use Proxy

  • Interface

    • IWatcherInfo
    {
        origin?: any;
        target: any;
        prop?: string | number;
        oldValue?: any;
        newValue?: any;
        propDepth?: propDepthType;
    }
      - origin: top parent object
      - target: target object
      - prop: property name or index
      - oldValue: old value of object[property]
      - oldValue: new value of object[property]
      - propDepth: object property depth array
          - A { 
              name: {
                  sub: 'change'
              }
          }
          - if change A.name.sub
          - propDepth ['name']
          - we can 'property name' from prop
           - A { 
              name: {
                  sub: {
                      sub2: 'change2'
                  }
              }
          }
          - if change A.name.sub.sub2
          - propDepth ['name','sub']
          - we can 'property name' from prop
        
  • Method

    • getter
      • proxy : return new proxy object
      • valueChangeSubject : return value change subject
        • subject data: IWatcherInfo
      • propChangeSubject : return property change subject
        • subject data: IWatcherInfo
      • orderChangerSubject : return new order change subject
        • subject data: changed indices array
  • Window Event(browser only)

    • changeObjectValues
    • changeObjectProps
    • changeArrayOrder
    • deleteObjectProp

GlobalLiteralWatcher

  • Global variable(literal) Watcher module
  • Interface
    • IWatcherInfo
    {
        target: any; 
        prop?: string | number;
        oldValue?: any;
        newValue?: any;
    }
      - target: target object
      - prop: property name or index
      - oldValue: old value of object[property]
      - oldValue: new value of object[property]
        
  • Method
    • getter
      • proxy : return new proxy object
      • valueChangeSubject : return value change subject
        • subject data: IWatcherInfo
    • watch(): start watch variable
    • stopWatch(): stop watch variable
  • Window Event(browser only)
    • onGlobalVarChange

How to Use

  • Typescript

    • Object Value and Propery change watch
    import { ObjectWatcher } from 'objectwatchers';
    
    /**
     * Object Watcher Rxjs Subject Example code
     */
    
    let testObject = {
        name: 'this is name'
    }
    
    console.log('original testObject is: ', testObject);
    
    //Make Object Watcher
    const testWatcher = new ObjectWatcher(testObject);
    //Getting proxy object, original object convert to proxy object
    testObject = testWatcher.proxy;
    
    /**
     * subscribe valueChangeSubject
     * this occur before object property value is changed
     */
    testWatcher.valueChangeSubject.subscribe((data) => {
      
    })
    
    /**
     * subscribe propChangeSubject
     * this occur before object property is added
     */
    testWatcher.propChangeSubject.subscribe((data) => {
      
    })
    
    //try change object property value
    testObject.name = 'this is name2';
    
    //try add object property
    testObject['name2'] = 'this is name2';
    
    • Array Value and Order change watch
    import { ObjectWatcher } from 'objectwatchers';
    
    /**
     * Object Watcher Rxjs Subject Example code
     */
    let testArray = [1,2,3,5,4,8,7,9];
    //Make Object Watcher
    const testArrayWatcher = new ObjectWatcher(testArray);
    
    //Getting proxy object, original object convert to proxy object
    testArray = testArrayWatcher.proxy;
    console.log(`original array is ${testArray}`);
    
    /**
     * subscribe valueChangeSubject
     * this occur before array property value is changed
     */
    testArrayWatcher.valueChangeSubject.subscribe( (data) => {
          
    });
    
    /**
     * subscribe propChangeSubject
     * this occur before array property value is changed
     */
    testArrayWatcher.propChangeSubject.subscribe( (data) => {
      
    });
    
    /**
     * subscribe propChangeSubject
     * this occur before array order is changed
     */
    testArrayWatcher.orderChangerSubject.subscribe( (data) => {
      
    });
    
    testArray = testArray.sort();
    testArray.push(100);
    
  • Nodejs

    • Object Value and Propery change watch
    const ObjectWatcher = require('objectwatchers').ObjectWatcher;
    
    /**
     * Object Watcher Rxjs Subject Example code
     */
    
    let testObject = {
        name: 'this is name'
    }
    
    console.log('original testObject is: ', testObject);
    
    //Make Object Watcher
    const testWatcher = new ObjectWatcher(testObject);
    //Getting proxy object, original object convert to proxy object
    testObject = testWatcher.proxy;
    
    /**
     * subscribe valueChangeSubject
     * this occur before object property value is changed
     */
    testWatcher.valueChangeSubject.subscribe((data) => {
      
    })
    
    /**
     * subscribe propChangeSubject
     * this occur before object property is added
     */
    testWatcher.propChangeSubject.subscribe((data) => {
      
    })
    
    //try change object property value
    testObject.name = 'this is name2';
    
    //try add object property
    testObject['name2'] = 'this is name2';
    
    
    testWatcher.propDeleteSubject.subscribe( (data: any) => {
        
    });
    delete testObject['obj']['namesss2']
    • Array Value and Order change watch
     const ObjectWatcher = require('objectwatchers').ObjectWatcher;
    
    /**
     * Object Watcher Rxjs Subject Example code
     */
    let testArray = [1,2,3,5,4,8,7,9];
    //Make Object Watcher
    const testArrayWatcher = new ObjectWatcher(testArray);
    
    //Getting proxy object, original object convert to proxy object
    testArray = testArrayWatcher.proxy;
    console.log(`original array is ${testArray}`);
    
    /**
     * subscribe valueChangeSubject
     * this occur before array property value is changed
     */
    testArrayWatcher.valueChangeSubject.subscribe( (data) => {
          
    });
    
    /**
     * subscribe propChangeSubject
     * this occur before array property value is changed
     */
    testArrayWatcher.propChangeSubject.subscribe( (data) => {
      
    });
    
    /**
     * subscribe propChangeSubject
     * this occur before array order is changed
     */
    testArrayWatcher.orderChangerSubject.subscribe( (data) => {
      
    });
    
    testArray = testArray.sort();
    testArray.push(100);
    
  • Global Value change watch(only for web browser)

    
    <head>
        <script src="../../dist/lib.bundle.umd.js"></script>
    </head>
    
    test = 'james.eo';
    const gWatcher = new GlobalLiteralWatcher();
          
    gWatcher.watch();
    
    gWatcher.valueChangeSubject.subscribe( (data) => {
      
    })
    
    window.addEventListener('onGlobalVarChange', (data) => {
          
    });
      
    test = 'james.eo2';