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

blue-cot

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blue-cot - npm Package Compare versions

Comparing version 2.0.10 to 3.0.0

.githooks/pre-commit/pre-commit

7

CHANGELOG.md
# CHANGELOG
*versions follow [SemVer](http://semver.org)*
## 3.0.0 - 2017-01-14
* Breaking change: removing constructors in favor of factory functions, breaking the module interface (see [Initialization](https://github.com/maxlath/blue-cot#initialization))
* New feature: [View functions](https://github.com/maxlath/blue-cot#view-functions)
* New feature: blue-cot is `this`-free! No need to bind functions context anymore!
## 2.0.0 - 2016-05-13
* Breaking change: updated bluereq to its [version 2.1.0](https://github.com/maxlath/bluereq/blob/master/CHANGELOG.md), returning rejected promises on 4xx errors
* Breaking change: updated bluereq to its [version 2.1.0](https://github.com/maxlath/bluereq/blob/master/CHANGELOG.md), returning rejected promises on 4xx errors

32

package.json

@@ -12,11 +12,9 @@ {

"scripts": {
"build": "coffee -c cot.coffee",
"watch": "coffee -cw cot.coffee",
"test": "mocha --compilers coffee:coffee-script/register",
"test-watch": "mocha --compilers coffee:coffee-script/register --watch",
"benchmark": "coffee benchmark/benchmark.coffee",
"prepublish": "npm build && npm test"
"test": "mocha",
"test-watch": "mocha --watch",
"lint": "standard",
"prepublish": "npm run lint && npm test"
},
"version": "2.0.10",
"main": "cot.js",
"version": "3.0.0",
"main": "lib/cot.js",
"dependencies": {

@@ -35,10 +33,16 @@ "bluereq": "^2.1.1"

"devDependencies": {
"benchmark": "^1.0.0",
"bluebird": "^3.4.0",
"chai": "^1.9.2",
"coffee-errors": "^0.8.6",
"coffee-script": "^1.10.0",
"cot": "0.0.6",
"mocha": "^2.0.1"
"config": "^1.24.0",
"git-hooks": "^1.1.7",
"mocha": "^2.0.1",
"should": "^11.1.2",
"standard": "^8.6.0"
},
"standard": {
"globals": [
"it",
"describe",
"beforeEach"
]
}
}

@@ -1,1 +0,75 @@

# [Bluebird](https://github.com/petkaantonov/bluebird)-based [Cot](https://github.com/willconant/cot-node)
[Bluebird](https://github.com/petkaantonov/bluebird)-based [Cot](https://github.com/willconant/cot-node) fork
# Installing
```
npm install blue-cot
```
## Differences with [Cot](https://github.com/willconant/cot-node)
* Returns [Bluebird](https://github.com/petkaantonov/bluebird) promises
* Class-less, thus a different initialization, but the rest of the API stays the same
* Consequently, `blue-cot` is `this`-free: no need to bind functions contexts!
* `4xx` and `5xx` responses will return rejected promises (should be handled with `.catch`)
* Adds [some view functions goodies](https://github.com/inventaire/blue-cot/blob/master/lib/view_functions.js)
### Initialization
```js
const bluecot = require('blue-cot')
const config = {
// MUST
hostname: 'localhost'
port: 5984,
// MAY
ssl: true
// use one of the two:
// together
auth: 'username:password'
// or separated
user: 'username'
pass: 'password'
// logs the generated URLs and body
debug: true
}
const getDbApi = bluecot(config)
const db = getDbApi('some-db-name')
```
### [API Reference](https://github.com/willconant/cot-node#promise--dbinfo)
Those are the same than for `cot-node`. Just remember this difference in error handling: here, `4xx` and `5xx` responses from CouchDB will return rejected promises (should be handled with `.catch`)
* docUrl
* info
* get
* exists
* put
* post
* batch
* update
* delete
* bulk
* buildQueryString
* viewQuery
* view
* allDocs
* viewKeysQuery
* viewKeys
* allDocsKeys
* changes
### View functions
To access those, pass a design doc name as second argument
```js
const db = getDbApi('some-db-name', 'some-design-doc-name')
```
* viewCustom
* viewByKeysCustom
* viewByKey
* viewFindOneByKey
* viewByKeys
see [lib/view_functions](https://github.com/inventaire/blue-cot/blob/master/lib/view_functions.js)
If you find this module useful, consider making a PR to improve the documentation

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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