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

couchdb-bulk2

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

couchdb-bulk2 - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

3

CHANGELOG.md
# CHANGELOG
*versions follow [SemVer](http://semver.org)*
## 2.2.0 - 2021-04-23
* Added a `-s, --sleep <milliseconds>` option
## 2.1.0 - 2021-04-23

@@ -5,0 +8,0 @@ * Added a `-l, --batch-length <number>` option

@@ -10,2 +10,3 @@ #!/usr/bin/env node

.option('-l, --batch-length <number>', 'set the number of documents to be sent in bulk to CouchDB per batch (default: 1000)')
.option('-s, --sleep <milliseconds>', 'defines the amount of time (in milliseconds) to wait once a batch was sent before sending a new one (default: 0)')
.version(version)

@@ -40,3 +41,3 @@

let docsPerBulk = 1000
const { batchLength } = program.opts()
const { batchLength, sleep } = program.opts()
if (batchLength) {

@@ -60,2 +61,4 @@ docsPerBulk = parseInt(batchLength)

const wait = ms => new Promise(resolve => setTimeout(resolve, ms))
let batch = []

@@ -77,2 +80,3 @@

await bulkPost(batchToPost)
if (sleep) await wait(sleep)
this.resume()

@@ -79,0 +83,0 @@ } catch (err) {

2

package.json
{
"name": "couchdb-bulk2",
"version": "2.1.0",
"version": "2.2.0",
"description": "Pipe newline-delimited JSON into CouchDB",

@@ -5,0 +5,0 @@ "main": "cli.js",

@@ -51,4 +51,5 @@ # couchdb-bulk2

* `-l, --batch-length <number>`: set the number of documents to be sent in bulk to CouchDB per batch (default: 1000)
* `-s, --sleep <milliseconds>`: defines the amount of time (in milliseconds) to wait once a batch was sent before sending a new one (default: 0)
## See also
* `couchdb-bulk2` works great in combinaison with [`ndjson-apply`](https://github.com/maxlath/ndjson-apply): see [data transformation workflow in the Inventaire project](https://github.com/inventaire/inventaire/blob/master/docs/data_transformation.md#data-transformation)
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