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.1.2
  • 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);
});

Some methods require 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

Callback only

  • getComments(cb)
  • getLastComments(cb);
  • getPolls(cb)
  • getLastPolls(cb)
  • getPosts(cb)
  • getLastPosts(cb)
  • getStories(cb)
  • getLastStories(cb)

String and callback

  • getItem(id, cb)
  • getUser(username, cb)
  • getUserComments(username, cb)
  • getLastUserComments(username, cb)
  • getUserPolls(username, cb)
  • getLastUserPolls(username, cb)
  • getUserStories(username, cb)
  • getLastUserStories(username, cb)
  • searchComments(query, cb)
  • searchLastComments(query, cb)
  • searchPosts(query, cb)
  • searchLastPosts(query, cb)
  • searchStories(query, cb)
  • searchLastStories(query, cb)

Object and callback

  • search(obj, cb)
  • searchLast(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