@moondef/hacker-news-api

2.0.6 • Public • Published

hacker-news-api

JavaScript wrapper for the official Hacker News API

npm package

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

Readme

Keywords

Package Sidebar

Install

npm i @moondef/hacker-news-api

Weekly Downloads

0

Version

2.0.6

License

MIT

Unpacked Size

3.64 kB

Total Files

7

Last publish

Collaborators

  • moondef