Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

couchdb-change-events

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

couchdb-change-events

This library will emit changes done in couchdb.

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
25
increased by66.67%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status Code Climate Issue Count Test Coverage

Easy interface to get object changes from CouchDb. This library is basically event emitter that emits changed objects, connection status and errors. If something happens with connection, it will be established again. Library checks also heartbeat and if new heartbeat is not received, connection will be reconnected. So Sit back and Relax, everything is taken care for you.

Key reasons why to choose this package are:

  • Follows CouchDb philosophy - Easy to use, bulletproof and you can sit back and relax.
  • When CouchDb is unreachable and comes back online, changes will be emitted again.
  • Reports connection status.
  • Reconnects on connection fail or heartbeats are not received anymore.
  • Always will be 100% test code coverage.

CouchdbChangeEvents(options)

Options for initializing library.

  • database: Name of the database to use for this connection. (Mandatory)
  • host: The hostname of the database you are connecting to. (Default: localhost)
  • port: The port number to connect to. (Default: 5984)
  • protocol: Protocol used to connect to CouchDb. http/https (Default: http)
  • includeDocs: Include the associated document with each result. (Default: true)
  • heartbeat: Period in milliseconds after which an empty line is sent in the results. (Default: 2000)
  • lastEventId: ID of the last events received by the server on a previous connection
  • autoConnect: If it's true then connection is started on initializing, otherwise connect function has to be called. (Default: true)

Usage

const CouchdbChangeEvents = require('couchdb-change-events');

const couchdbEvents = new CouchdbChangeEvents({
  database: 'my_database'
});

couchdbEvents.on('data', (data) => {
  console.log('data', data);
});

couchdbEvents.on('couchdb_status', (status) => {
  console.log(`couchdb status: ${status}`);
});

couchdbEvents.on('couchdb_error', (error) => {
  console.log('error', error);
});

Keywords

FAQs

Package last updated on 01 Mar 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc