Socket
Socket
Sign inDemoInstall

couchdb-transactions

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    couchdb-transactions

Couchdb all or nothing transactions without deps


Version published
Maintainers
1
Install size
15.3 kB
Created

Readme

Source

Couchdb transactions

Inspired by txn this library loads, modifies and commits documents to couchdb. It also will retry failed requests. The libray has zero dependencies but requires an instance of nano.

pipeline status coverage report

Usage

const couchdbTxn = require('couchdb-transactions');
const db = require('nano')('http:....');

function sumTransaction(doc) {
    doc.sum = 1 + (doc.sum || 0);
}

let txn = couchdbTxn(db, sumTransaction);

let doc = {_id:'xyz'};

txn(doc, function (err, response){
    console.log('response', response);
);

Contributing

Please respect the .eslintrc configuration.
Also, you will need to create a .env file with the URL of your CouchDB server.
See .env.sample

Keywords

FAQs

Last updated on 26 Nov 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc