A promise based wrapper for the Firebase Hacker News API
npm i node-hn-api
const hn = require('node-hn-api');
hn.fetchTopStories(5)
.then((topStories) => {
//..
})
.catch((err) => {
console.error(err);
});
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
Number of records to fetch
fetchNewStories([numberOfStories]) - Fetch Hacker News New Stories data
Returns a promise
Number of records to fetch
fetchBestStories([numberOfStories]) - Fetch Hacker News Best Stories data
Returns a promise
Number of records to fetch
fetchAskStories([numberOfStories]) - Fetch Ask Hacker News Stories data
Returns a promise
Number of records to fetch
fetchShowStories([numberOfStories]) - Fetch Show Hacker News Stories data
Returns a promise
Number of records to fetch
fetchJobStories([numberOfStories]) - Fetch Hacker News Job Stories data
Returns a promise
Number of records to fetch