Socket
Socket
Sign inDemoInstall

stackexchange

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stackexchange - npm Package Compare versions

Comparing version 0.0.7 to 0.1.0

lib/methods/users.js

2

lib/config.js

@@ -10,3 +10,3 @@ 'use strict';

, site: 'stackoverflow'
, version: 2.1
, version: 2.2
});

@@ -13,0 +13,0 @@

@@ -52,5 +52,10 @@ 'use strict';

, function response (error, res) {
if (!error) parseBody.call(this, res.body, callback);
if (error) {
callback(error);
}
else {
parseBody.call(this, res.body, callback);
}
}
);
};
'use strict';
var util = require('utile')
, config = require('./config')
, search = require('./methods/search')
, questions = require('./methods/questions');
, config = require('./config')
, search = require('./methods/search')
, questions = require('./methods/questions')
, users = require('./methods/users');

@@ -15,12 +16,13 @@ /**

*/
module.exports = function StackExchange (options) {
// Mitigate options to config.
this.config = config;
Object.keys(options || {}).forEach(function setConfig (key) {
config.set(key, options[key]);
});
module.exports = function StackExchange(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;
// Expose methods.
this.search = search;
this.questions = questions;
this.users = users;
};
{
"name": "stackexchange",
"version": "0.0.7",
"version": "0.1.0",
"description": "Node.js implementation of the stackexchange/stackoverflow API",
"main": "./lib/stackexchange",
"scripts": {
"test": "make test"
"test": "NODE_ENV=test ./node_modules/.bin/mocha $(find test -name '*.test.js')"
},

@@ -14,7 +14,14 @@ "repository": {

"dependencies": {
"nconf": "0.6.7",
"request": "2.12.0",
"devnull": "0.0.10",
"utile": "0.1.7"
"nconf": "0.6.x",
"request": "2.21.x",
"devnull": "0.0.x",
"utile": "0.2.x"
},
"devDependencies": {
"mocha": "1.10.x",
"chai": "1.6.x",
"sinon": "1.7.x",
"sinon-chai": "2.4.x",
"pre-commit": "0.0.x"
},
"keywords": [

@@ -21,0 +28,0 @@ "stackoverflow",

@@ -5,1 +5,35 @@ # Stackexchange API for Node.js

answers.
Installation
----
```
npm install stackexchange --save
```
Usage
----
```js
var stackexchange = require('stackexchange');
var options = { version: 2.2 };
var context = new stackexchange(options);
var filter = {
key: 'YOUR_API_KEY',
pagesize: 50,
tagged: 'node.js',
sort: 'activity',
order: 'asc'
};
// Get all the questions (http://api.stackexchange.com/docs/questions)
context.questions.questions(filter, function(err, results){
if (err) throw err;
console.log(results.items);
console.log(results.has_more);
});
```

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