node-hn-api
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
3.0.02latest

Version History

VersionDownloads (Last 7 Days)Published
3.0.02
2.1.10
2.1.00
2.0.00
1.2.00
1.1.10
1.1.03
1.0.40
1.0.30
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i node-hn-api

Weekly Downloads

5

Version

3.0.0

License

MIT

Unpacked Size

628 kB

Total Files

6

Last publish

Collaborators

  • arjunsajeev