hacker-news-api-types
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

hacker-news-api-types

TypeScript interfaces for the Hacker News API JSON data

Install

npm install hacker-news-api-types

How to use

import { IUser, IItem } from "hacker-news-api-types";

fetch("https://hacker-news.firebaseio.com/v0/user/whoishiring.json").then(
  response => {
    response.json().then((user: IUser) => user.about);
  }
);

fetch("https://hacker-news.firebaseio.com/v0/item/17205865.json").then(
  async response => {
    const post = (await response.json()) as IItem;
    post.descendants;
  }
);

screenshot

Readme

Keywords

none

Package Sidebar

Install

npm i hacker-news-api-types

Weekly Downloads

8

Version

2.0.0

License

MIT

Unpacked Size

1.83 MB

Total Files

5

Last publish

Collaborators

  • nunoarruda