stackexchange
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -1,1 +0,1 @@ | ||
require('./lib/stackexchange'); | ||
module.exports = require('./lib/stackexchange'); |
'use strict'; | ||
/** | ||
* Required modules. | ||
*/ | ||
var util = require('utile'); | ||
var util = require('utile') | ||
, config = require('./config') | ||
, search = require('./methods/search') | ||
, questions = require('./methods/questions'); | ||
/** | ||
* Default configuration. | ||
*/ | ||
var config = { | ||
'version': 2.1, | ||
'site': 'stackoverflow' | ||
}; | ||
/** | ||
* Initialize StackExchange API. | ||
@@ -24,3 +16,11 @@ * | ||
function StackExchange (options) { | ||
this.config = util.mixin(config, options); | ||
// Mitigate options to config. | ||
this.config = config; | ||
Object.keys(options || {}).forEach(function setConfig (key) { | ||
config.set(key, options[key]); | ||
}); | ||
// Expose methods. | ||
this.search = search; | ||
this.questions = questions; | ||
} | ||
@@ -27,0 +27,0 @@ |
{ | ||
"name": "stackexchange", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Node.js implementation of the stackexchange/stackoverflow API", | ||
@@ -14,2 +14,5 @@ "main": "index.js", | ||
"dependencies": { | ||
"nconf": "0.6.7", | ||
"request": "2.12.0", | ||
"devnull": "0.0.10", | ||
"utile": "0.1.7" | ||
@@ -16,0 +19,0 @@ }, |
Sorry, the diff of this file is not supported yet
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
4993
10
150
4
+ Addeddevnull@0.0.10
+ Addednconf@0.6.7
+ Addedrequest@2.12.0
+ Addedcolors@0.6.0-1(transitive)
+ Addeddevnull@0.0.10(transitive)
+ Addedini@1.3.8(transitive)
+ Addednconf@0.6.7(transitive)
+ Addedoptimist@0.3.7(transitive)
+ Addedpkginfo@0.2.3(transitive)
+ Addedrequest@2.12.0(transitive)
+ Addedwordwrap@0.0.3(transitive)