node-hn-api
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
Item data
fetchItem(itemId) - Fetch Hacker NewsReturns a promise
User data
fetchUser(userId) - Fetch Hacker NewsReturns a promise
Top Stories data
fetchTopStories([numberOfStories]) - Fetch Hacker NewsReturns a promise
numberOfStories - number
Number of records to fetch
New Stories data
fetchNewStories([numberOfStories]) - Fetch Hacker NewsReturns a promise
numberOfStories - number
Number of records to fetch
Best Stories data
fetchBestStories([numberOfStories]) - Fetch Hacker NewsReturns a promise
numberOfStories - number
Number of records to fetch
Ask Hacker News Stories data
fetchAskStories([numberOfStories]) - FetchReturns a promise
numberOfStories - number
Number of records to fetch
Show Hacker News Stories data
fetchShowStories([numberOfStories]) - FetchReturns a promise
numberOfStories - number
Number of records to fetch
Job Stories data
fetchJobStories([numberOfStories]) - Fetch Hacker NewsReturns a promise
numberOfStories - number
Number of records to fetch