# oploggery

> A MongoDB oplog watcher for Node.js

Latest version **0.1.1** (published 2014-09-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install oploggery
pnpm add oploggery
yarn add oploggery
bun add oploggery
```

## 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.1.1 |
| Published | 2014-09-25 |
| First published | 2014-09-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Benjamin Kitt |
| Maintainers | benjaminkitt |
| Keywords | mongodb, oplog, watch, nodejs, javascript |

## Links

- npm: https://www.npmjs.com/package/oploggery
- Repository: https://github.com/entangler/oploggery
- Issues: https://github.com/entangler/oploggery/issues
- npm.io page: https://npm.io/package/oploggery

## Dependencies (1)

- [mongodb](https://npm.io/package/mongodb.md) ^1.4.14

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 0.1.1 (latest) — 2014-09-25
- 0.1.0 — 2014-09-24

## README

Oploggery
=========

A MongoDB oplog watcher for Node.js, part of the entangler.js project.

Oploggery is based off the fabulous [Mongo Watch](https://github.com/TorchlightSoftware/mongo-watch) project by [Brandon Mason](https://github.com/bitmage), re-written in JavaScript (sorry CoffeeScripters!) and updated to give more flexibility when connecting to your database.

Many of the options are similar to Mongo Watch, but the connection options have been completely replaced with `client` and `uri` options.  

`client` allows you to pass an already connected MongoClient instance from the [MongoDB Node.js native driver](https://github.com/mongodb/node-mongodb-native) (see [MongoClient()](http://mongodb.github.io/node-mongodb-native/api-generated/mongoclient.html).)

`uri` allows you to pass a MongoDB connection URI string, frequently generated by hosted MongoDB services such as [compose.io](http://compose.io/).  A simple URI for a local MongoDB server might look like this:

> `mongodb://localhost:27017/test`

# Install

To install oploggery from npm, run: 

> `npm install oploggery`

# Usage

To watch a collection:

```JavaScript
var Oploggery = require('Oploggery');

var oplogger = new Oploggery({
	uri: 'mongodb://localhost:27017/test',
	format: 'pretty'
});

// Database is 'test', collection is 'users'
oplogger.watch('test.users', function(event) {
	console.log(event);
});
```

# Credits

This library is based heavily off [Mongo Watch](https://github.com/TorchlightSoftware/mongo-watch) by [Brandon Mason](https://github.com/bitmage).  Big thanks for making this so easy!

*More documentation, tests, examples etc. to come!*

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