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

nano

Package Overview
Dependencies
Maintainers
1
Versions
155
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nano - npm Package Compare versions

Comparing version 0.5.8 to 0.6.0

tests/shared/cfg.js

40

nano.js

@@ -17,8 +17,9 @@ /* minimal couch in node

*/
var request = require('request')
, fs = require('fs')
, qs = require('querystring')
, _ = require('underscore')
, error = require('./error')
, headers = { "content-type": "application/json" }
var request = require('request')
, fs = require('fs')
, qs = require('querystring')
, _ = require('underscore')
, error = require('./error')
, headers = { "content-type": "application/json" }
, default_url = "http://localhost:5984"
, nano;

@@ -38,8 +39,7 @@

if(typeof cfg === "string") {
try {
cfg = require(cfg); // no cfg? maybe it's a file path?
if(/^https?:/.test(cfg)) { cfg = {url: cfg}; } // url
else {
try { cfg = require(cfg); } // file path
catch(e) { console.error("bad cfg: couldn't load file"); }
}
catch(e) {
cfg = {url: cfg}; // not a file path? guess it's the url
}
}

@@ -49,2 +49,6 @@ if(cfg.proxy) {

}
if(!cfg.url) {
console.error("bad cfg: using default=" + default_url);
cfg = {url: default_url}; // if everything else fails, use default
}

@@ -245,14 +249,2 @@ /****************************************************************************

}
/*
* returns couchdb + nano configuration
*
* @see relax
*/
function config(callback) {
return relax({db: "_config", method: "GET"}, function (e,h,r) {
if(e) { callback(e); }
callback(null,h,{nano: cfg, couch: r});
});
}

@@ -458,3 +450,3 @@ /****************************************************************************

, request: relax
, config: config
, config: cfg
, relax: relax // alias

@@ -461,0 +453,0 @@ , dinosaur: relax // alias

2

package.json
{ "name": "nano"
, "description": "minimalistic couchdb driver for node.js"
, "homepage": "http://github.com/dscape/nano"
, "version": "0.5.8"
, "version": "0.6.0"
, "author": "Nuno Job <nunojobpinto@gmail.com> (http://nunojob.com)"

@@ -6,0 +6,0 @@ , "keywords": ["couchdb", "data", "request", "json", "nosql", "micro", "nano"]

@@ -77,3 +77,3 @@ # nano

`nano.request(opts,callback*)`
`nano.config(callback)`
`nano.config`

@@ -80,0 +80,0 @@ ### aliases

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