Comparing version 0.0.3 to 0.0.4
23
index.js
@@ -7,3 +7,3 @@ 'use strict' | ||
const protocol = "http"; // hostname = "localhost", port = 5984; | ||
const protocol = "http"; | ||
@@ -25,3 +25,3 @@ class DBHandler { | ||
if (data.error) { | ||
DBHandler.createDB(db, (error) => { | ||
DBHandler.createDB(this.config, db, (error) => { | ||
if (error) throw new Error("Database Creation error"); | ||
@@ -34,7 +34,7 @@ }); | ||
static getNewId(callback) { | ||
static getNewId(options, callback) { | ||
if (!callback) callback = console.log; | ||
http.request({ | ||
hostname: this.config.hostname, | ||
port: this.config.port, | ||
hostname: options.hostname, | ||
port: options.port, | ||
method: 'GET', | ||
@@ -187,7 +187,7 @@ path: '/_uuids' | ||
static createDB(dbName, callback) { | ||
static createDB(options, dbName, callback) { | ||
if (!callback) callback = console.log; | ||
http.request({ | ||
hostname: this.config.hostname, | ||
port: this.config.port, | ||
hostname: options.hostname, | ||
port: options.port, | ||
method: 'PUT', | ||
@@ -208,7 +208,7 @@ path: '/'+encodeURIComponent(dbName) | ||
static deleteDB(dbName, callback) { | ||
static deleteDB(options, dbName, callback) { | ||
if (!callback) callback = console.log; | ||
http.request({ | ||
hostname: this.config.hostname, | ||
port: this.config.port, | ||
hostname: options.hostname, | ||
port: options.port, | ||
method: 'DELETE', | ||
@@ -231,2 +231,1 @@ path: '/'+encodeURIComponent(dbName) | ||
module.exports = DBHandler; | ||
{ | ||
"name": "couchdbjs", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "A node client for couchdb.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9724