New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

diffsync-couchdb

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

diffsync-couchdb

A CouchDB data adapter for diffsync

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

diffsync-CouchDB

A CouchDB data adapter for diffsync

Usage

The CouchDB adapter needs a reference to a database object to write to. This database object is expected to have a cradle-like interface. For reading, it uses get(id, callback) and for writing it uses save(id, doc._rev, data, callback).

  var CouchDBDataAdapter = require('diffsync-couchdb'),
      cradle             = require('cradle'),
      diffsync           = require('diffsync'),

      couchDbAdapter, database, server;

  // set up your CouchDB driver (cradle or cradle-compatible)
  // (...)

  // create a database object
  database = (new cradle.Connection()).database(databaseName)

  // pass it on to the adapter
  couchDbAdapter = new CouchDBDataAdapter(database);

  // pass the adapter to diffsync
  server = new diffsync.Server(couchDbAdapter, socketIO);

This adapter assumes that while a document is being edited with diffsync, there is no other manipulating it. Which means, this adapter always overrides the latest version from your database with the latest version from diffsync.

Example

For a more complete example, check out diffsync-todos.

Keywords

FAQs

Package last updated on 25 May 2015

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