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

hacker-news-api

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hacker-news-api

Node.js library for Algolia's Hacker News API

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15
increased by7.14%
Maintainers
1
Weekly downloads
 
Created
Source

Node.js Hacker News API

A Node.js library for seamless integration with Algolia's kickass Hacker News API.

Installation

npm install hacker-news-api

Examples

Some methods only require a callback.

var hn = require('hacker-news-api');

hn.getLastPolls(function (error, data) {
  if (error) throw error;
  console.log(data);
});

Some methods require a string and a callback.

var hn = require('hacker-news-api');

hn.getUserStories('pg', function (error, data) {
  if (error) throw error;
  console.log(data);
});

The api.search method requires an object and a callback.

var hn = require('hacker-news-api');

hn.search({
  query: 'javascript',
  tags: 'poll'
}, function (error, data) {
  if (error) throw error;
  console.log(data);
});

Methods

  • getItem(id, cb)
  • getUser(username, cb)
  • getLastStories(cb)
  • getLastPolls(cb)
  • getLastPosts(cb)
  • getUserStories(username, cb)
  • searchStories(search, cb)
  • searchPolls(search, cb)
  • search(obj, cb)

Keywords

FAQs

Package last updated on 12 Apr 2014

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