# simple-watch

> Trigger callbacks when objects, properties or expressions change.

Latest version **0.0.4** (published 2013-06-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-watch
pnpm add simple-watch
yarn add simple-watch
bun add simple-watch
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2013-06-10 |
| First published | 2013-06-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Tim Oxley |
| Maintainers | timoxley |

## Links

- npm: https://www.npmjs.com/package/simple-watch
- Repository: https://github.com/timoxley/simple-watch
- Issues: https://github.com/timoxley/simple-watch/issues
- npm.io page: https://npm.io/package/simple-watch

## Dependencies (1)

- [to-function](https://npm.io/package/to-function.md) ~1.2.0

## Recent versions

- 0.0.4 (latest) — 2013-06-10
- 0.0.3 — 2013-06-10
- 0.0.1 — 2013-06-10

## README

# simple watch

  Fires events when objects change.

## Installation

    $ component install timoxley/simple-watch

## Examples

### Watch object properties

```js
var user = {name: 'Tim', age: 27}

watch(user, 'name', function(current, previous) {
  console.log('Name was '+ previous +'. Name is now '+ current +'.')
})

user.name = 'Tim Oxley'
// => Name was Tim. Name is now Tim Oxley
```

### Watch expressions
```js
var user = {name: 'Tim', age: 27}

watch(user, 'age > 27', function() {
  console.log(user.name ' is now ' + user.age)
})

user.age++

// => Tim is now 28

``` 

## License

  MIT

---
_Source: https://npm.io/package/simple-watch · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
