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

stackexchange-api

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stackexchange-api

A Node.js wrapper for the StackExchange API

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

stackexchange-api

npm CircleCI npm NPM GitHub issues

A Node.js wrapper for the StackExchange API

Documentation

Disclaimer: WIP. Doesn't work with many endpoints yet.

Features:

  • stackexchange-api provides a simple way to access the StackExchange API endpoints
  • All complex data types from the API have a corresponding Object
  • stackexchange-api is written in TypeScript and every field of every request option / result has (will eventually have) type definitions. As a result, modern editors are able to provide extensive autocompletion.

Installation

Using npm:

npm install --save stackexchange-api

Using yarn:

yarn add stackexchange-api

Usage

Including in a project:

  • ES6:
import {StackExchange} from 'stackexchange-api';
  • CommonJS:
const StackExchangeApi = require('stackexchange-api');

Example usage:

import {StackExchange} from 'stackexchange-api';
StackExchange.search({ // Equivalent to the /search endpoint. Go to https://paul-soporan.github.io/stackexchange-api/classes/stackexchange.html#search for details.
  inTitle: 'nodejs',
  site: 'stackoverflow'
}).then((result) => {
  console.log(result);
  // Output: Wrapper<Question>
  console.log(result.items);
  // Output: an array of Questions (Question[])
  console.log(result.items[0]);
  // Output: the first Question
  console.log(result.items[0].viewCount);
  // Output: the view count of the first Question
});

Keywords

FAQs

Package last updated on 11 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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