@moondef/hacker-news-api
v2.0.6
Published
API for news.ycombinator.com
Downloads
53
Readme
hacker-news-api
JavaScript wrapper for the official Hacker News API
Usage
$ npm install --save @moondef/hacker-news-api
or
$ yarn add @moondef/hacker-news-api
const hk = require('@moondef/hacker-news-api');
(async () => {
const popular = await hk.getPopular(); // you will get IDs of popular news
const newsItem = await hk.getItem(popular[0]);
console.log(newsItem);
})();
Methods
- getPopular() // Array
- getUser(nickname) // Object
- getItem(id) // Object
- getMaxItem() // Number
- getAskStories() // Array
- getShowStories() // Array
- getJobStories() // Array
- getUpdates() // Object
- getNewStories() // Array
- getTopStories() // Array
- getBestStories() // Array