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

node-hn-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

node-hn-api

A promise based wrapper for the [Firebase Hacker News API](https://github.com/HackerNews/API)

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

node-hn-api Build Status npm PRs Welcome

A promise based wrapper for the Firebase Hacker News API

Installation

npm i node-hn-api

Usage

const hn = require('node-hn-api');
hn.fetchTopStories(5)
  .then((topStories) => {
    //..
  })
  .catch((err) => {
    console.error(err);
  });

API

fetchItem(itemId) - Fetch Hacker News Item data

Returns a promise

fetchUser(userId) - Fetch Hacker News User data

Returns a promise

fetchTopStories([numberOfStories]) - Fetch Hacker News Top Stories data

Returns a promise

numberOfStories - number

Number of records to fetch

fetchNewStories([numberOfStories]) - Fetch Hacker News New Stories data

Returns a promise

numberOfStories - number

Number of records to fetch

fetchBestStories([numberOfStories]) - Fetch Hacker News Best Stories data

Returns a promise

numberOfStories - number

Number of records to fetch

fetchAskStories([numberOfStories]) - Fetch Ask Hacker News Stories data

Returns a promise

numberOfStories - number

Number of records to fetch

fetchShowStories([numberOfStories]) - Fetch Show Hacker News Stories data

Returns a promise

numberOfStories - number

Number of records to fetch

fetchJobStories([numberOfStories]) - Fetch Hacker News Job Stories data

Returns a promise

numberOfStories - number

Number of records to fetch

Keywords

FAQs

Package last updated on 05 Sep 2023

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