{"_id":"5984","_rev":"6-4ab4e2abdf2a8b32da5f0eeceeca0d30","name":"5984","description":"Lightweight CouchDB CLI and API for efficient stream processing.","dist-tags":{"latest":"1.1.0"},"versions":{"0.0.1":{"name":"5984","version":"0.0.1","description":"CouchDB tools","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/jo/5984.git"},"keywords":["CouchDB"],"author":{"name":"Johannes J. Schmidt"},"license":"Apache-2.0","bugs":{"url":"https://github.com/jo/5984/issues"},"homepage":"https://github.com/jo/5984#readme","gitHead":"224320c844c70edc6311a78a904e2a8e46506812","_id":"5984@0.0.1","_shasum":"868e08387cabde78e94ed498e2c7fccdbb943971","_from":".","_npmVersion":"3.10.7","_nodeVersion":"7.0.0","_npmUser":{"name":"jo","email":"schmidt@netzmerk.com"},"dist":{"shasum":"868e08387cabde78e94ed498e2c7fccdbb943971","tarball":"https://registry.npmjs.org/5984/-/5984-0.0.1.tgz","integrity":"sha512-V8T3PvfKXGjYnk6BDK+l74LtVZACad4Sjw8f5JGXzQa5w66jRhgkkfKkEn+ZkuKloNwDTc+7HPsWI0Y00GMF4g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDL153nhBcWbjRHJfsLguD6D38TiblOFBra94Z0xYPm9QIhAIVnfiWViMVFPIpM5G4tQWff8TLvz57BSVmRhng/qebW"}]},"maintainers":[{"name":"jo","email":"schmidt@netzmerk.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/5984-0.0.1.tgz_1479805014070_0.6419895123690367"}},"0.0.2":{"name":"5984","version":"0.0.2","description":"CouchDB tools","main":"index.js","bin":{"5984":"cli.js"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/jo/5984.git"},"keywords":["CouchDB"],"author":{"name":"Johannes J. Schmidt"},"license":"Apache-2.0","bugs":{"url":"https://github.com/jo/5984/issues"},"homepage":"https://github.com/jo/5984#readme","gitHead":"771d2397fa13b8b0fd6cf74b69b5061640195f77","_id":"5984@0.0.2","_shasum":"92795b5147feb936f074bc6fc5898ea2823a1516","_from":".","_npmVersion":"3.10.7","_nodeVersion":"7.0.0","_npmUser":{"name":"jo","email":"schmidt@netzmerk.com"},"dist":{"shasum":"92795b5147feb936f074bc6fc5898ea2823a1516","tarball":"https://registry.npmjs.org/5984/-/5984-0.0.2.tgz","integrity":"sha512-J+HMOGOQmnX5Ei8PaT7kJ2EPlg7eOClTFW+LUoIDXzTIrj5vKPHn2ZvhTEbX/C1bOrwu+EpBVCCXfikBpzQHag==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMUseJHsVl1Mb/uGvjJ5Jv8zMcmmru91RIDWa0CF7nTgIgELBczhEJ+/DJJ2H0EN/YpGu1L2l9l25TntGUFo9+KVg="}]},"maintainers":[{"name":"jo","email":"schmidt@netzmerk.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/5984-0.0.2.tgz_1479805099717_0.4433287703432143"}},"1.0.0":{"name":"5984","version":"1.0.0","description":"Lightweight CouchDB CLI and API for efficient stream processing.","main":"index.js","bin":{"5984":"cli.js","fnef":"cli.js"},"scripts":{"pretest":"standard","test":"tap test/test-*.js"},"repository":{"type":"git","url":"git+https://github.com/jo/5984.git"},"keywords":["CouchDB","ndjson","cli"],"author":{"name":"Johannes J. Schmidt"},"license":"Apache-2.0","bugs":{"url":"https://github.com/jo/5984/issues"},"homepage":"https://github.com/jo/5984#readme","dependencies":{"JSONStream":"^1.2.1","commander":"^2.9.0","couchdb-compile":"^1.7.0","ndjson":"^1.5.0","readable-stream":"^2.2.2","split2":"^2.1.0","through2":"^2.0.3"},"devDependencies":{"standard":"^8.6.0","tap":"^8.0.1"},"gitHead":"b3c9e1f21be4d90fcd9a0500cf9f37a833f4cd7b","_id":"5984@1.0.0","_shasum":"5a176750c95db1efef4dbc7b5d10c4e0432077e9","_from":".","_npmVersion":"3.10.7","_nodeVersion":"7.2.1","_npmUser":{"name":"jo","email":"schmidt@netzmerk.com"},"dist":{"shasum":"5a176750c95db1efef4dbc7b5d10c4e0432077e9","tarball":"https://registry.npmjs.org/5984/-/5984-1.0.0.tgz","integrity":"sha512-+KNdslgK8yuF3Ofzx4vkaWp+IiaPryeeFShg9K+wqackaugMZAZuj/0GfC7VXJzSE4+WvK58cIBun/CizvtFBA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAxcYFFsCS4qerR1yP584cjdWkcFPxVHH9JwMBoM5NojAiEAyJ0H8zoLYGYJEHBpEGL4q71+ZHfc+ODRBMnJmj7AjqY="}]},"maintainers":[{"name":"jo","email":"schmidt@netzmerk.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/5984-1.0.0.tgz_1481320097190_0.5288098820019513"}},"1.1.0":{"name":"5984","version":"1.1.0","description":"Lightweight CouchDB CLI and API for efficient stream processing.","main":"index.js","bin":{"5984":"cli.js","fnef":"cli.js"},"scripts":{"pretest":"standard","test":"tap test/test-*.js","semantic-release":"semantic-release pre && npm publish && semantic-release post"},"repository":{"type":"git","url":"git+https://github.com/jo/5984.git"},"keywords":["CouchDB","ndjson","cli"],"author":{"name":"Johannes J. Schmidt"},"license":"Apache-2.0","bugs":{"url":"https://github.com/jo/5984/issues"},"homepage":"https://github.com/jo/5984#readme","dependencies":{"JSONStream":"^1.2.1","commander":"^2.9.0","couchdb-compile":"^1.7.0","ndjson":"^1.5.0","readable-stream":"^2.2.2","split2":"^2.1.0","through2":"^2.0.3"},"devDependencies":{"standard":"^8.6.0","tap":"^8.0.1","semantic-release":"^6.3.2"},"gitHead":"a0d9790958b1e84edc957cb0c9c0b767d00eb21d","_id":"5984@1.1.0","_shasum":"472063910ae8f379ed475951c87c0fcd91bf4328","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"jo","email":"schmidt@netzmerk.com"},"dist":{"shasum":"472063910ae8f379ed475951c87c0fcd91bf4328","tarball":"https://registry.npmjs.org/5984/-/5984-1.1.0.tgz","integrity":"sha512-srHWq9ave8lG7jTM0iIjiDwprx41ZgasVR6elld9ScEQiKvBuPrqFtLNr7GVo9VLclke9fKLwT3xbH756QM21Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBiUMJyOw0vqq1E7lGePF0mYt7Rx/E3ZkEyaRiGZf3JQIgL9Talwx6Iy8baikWUSCFB0scAZT7k+zPTRh7UEsUGQM="}]},"maintainers":[{"name":"jo","email":"schmidt@netzmerk.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/5984-1.1.0.tgz_1498686317265_0.16035143611952662"}}},"readme":"# 5984\n_Lightweight CouchDB CLI and Node API for efficient stream processing._\n\n5984 is a set of a few specific tools. Chaining provides wide flexibility.\n```sh\n5984 batch -n 1000 docs.ndjson \\\n  | 5984 fetch-revs mydb \\\n  | 5984 batch -n 100 \\\n  | 5984 bulk mydb\n```\n\nFor now 5984 provides the following commands:\n\n* **bulk-docs:** push document to couchdb\n* **fetch-revs:** fetch document revisions\n* **compile:** compile couchapp directories and modules\n* **batch:** batch documents\n\nPlease [share your thoughts](https://github.com/jo/5984/issues/new) - what is\nimportant to you and where you'd see a good fit for it.\n\nThe commandline client handles [Newline Delimited JSON](http://ndjson.org/),\nwhich is a perfect fit for CouchDB for many reasons. CouchDB also provides its\ncontinuous changes feed as ndjson.\n\n[![Build Status](https://travis-ci.org/jo/5984.svg?branch=master)](https://travis-ci.org/jo/5984)\n\n## Installation\n```sh\nnpm install 5984 -g\n```\n\n\n## Interface\nYou can feed the 5984 CLI either with ndjson files provided via commandline\nargument or via stdin:\n```sh\n5984 bulk mydb docs.ndjson\necho '{\"_id\": \"mydoc\"}' | 5984 bulk mydb\n```\n\nThe Node API has a stream interface:\n```js\nvar fnef = require('5984')\nvar bulk = fnef.bulkDocs('mydb')\nbulk.on('data', function (response) {\n  console.log(response)\n})\nbulk.write({ _id: 'mydoc' })\n```\n\n\n## Input Format\nDocuments can can be given using different formats:\n\n##### Single Doc\nInput chunk can be a single document object:\n```json\n{ \"_id\": \"one\" }\n```\n##### Array of Docs\n...or an array of docs:\n```json\n[\n  { \"_id\": \"one\" },\n  { \"_id\": \"two\" }\n]\n```\n##### Docs Object\n...or an object with a `docs` property with an array of docs, like eg. used in\n`_bulk_docs` requests:\n```json\n{\n  \"docs\": [\n    { \"_id\": \"one\" },\n    { \"_id\": \"two\" }\n  ]\n}\n```\n\n\n## Common Options\nThere are some global options:\n\n* `options.url`: CouchDB server url (defaults to http://localhost:5984)\n* `options.username`: username to authenticate with\n* `options.password`: password to authenticate with\n\n\n## Commands & API\nCommands are invoked in a Git-style manner: `5984 <command> [options]`\nRun `5984` without an argument or `5984 help` for detailed CLI usage.\n\nThe API can be imported either as a whole or directly:\n```js\nvar fnef = require('5984')\nvar bulkDocs = require('5984/bulk-docs')\n```\n\nAll API endpoints return a readable stream in object mode.\n\n### bulkDocs(db, options)\nPost documents via `_bulk_docs` to a CouchDB.\n\n* `db`: database url. Can also be a database name, in which case the host from `options.url` is used.\n\n\n### fetchRevs(db, options)\nQueries current revisions from database via `_all_docs` request and inserts them\ninto the documents.\n\n* `db`: database url. Can also be a database name, in which case the host from `options.url` is used.\n\n\n### compile([source], options)\nCompile couchapp directories and CommonJS modules. See\n[couchdb-compile](https://github.com/jo/couchdb-compile) for details.\n\nInput is *not* ndjson but plain newline delimited filenames. \nIf `source` is provided, use it as input rather than a stream of filenames.\n\n* `source`: compile source file. Optional.\n* `options.index`: look for `index.js` files. Default is false.\n\n\n### batch(options)\nGroup documents to batches.\n\n* `options.size`: batch size (default is 100)\n\n\n## Examples\n\n##### Compile design document and push it to the couch:\n```sh\n$ 5984 compile ./ddoc | 5984 fetch-revs mydb | 5984 bulk-docs mydb\n{\"ok\":true,\"id\":\"_design/myapp\",\"rev\":\"1-967a00dff5e02add41819138abb3284d\"}\n```\n\n##### Create a force push chain with optimized batching: \n```sh\n5984 batch -n 1000 docs.ndjson \\\n  | 5984 fetch-revs mydb \\\n  | 5984 batch -n 100 \\\n  | 5984 bulk mydb\n```\nFirst the input docs are batched into 1000er batches. For each batch a request\nis being made to retrieve current revisions of the documents. Now the docs are\nagain batched, this time into 100er batches. These batches are posted to\nCouchDB.\n\nPlease also have a look at the tests.\n\n\n## License\nApache 2.0.\n\n(c) 2016 Johannes J. Schmidt\n","maintainers":[{"name":"jo","email":"schmidt@netzmerk.com"}],"time":{"modified":"2022-06-12T14:08:09.979Z","created":"2016-11-22T08:56:55.996Z","0.0.1":"2016-11-22T08:56:55.996Z","0.0.2":"2016-11-22T08:58:20.239Z","1.0.0":"2016-12-09T21:48:19.174Z","1.1.0":"2017-06-28T21:45:18.276Z"},"homepage":"https://github.com/jo/5984#readme","keywords":["CouchDB","ndjson","cli"],"repository":{"type":"git","url":"git+https://github.com/jo/5984.git"},"author":{"name":"Johannes J. Schmidt"},"bugs":{"url":"https://github.com/jo/5984/issues"},"license":"Apache-2.0","readmeFilename":"README.md"}