Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

nunoarruda/hacker-news-api-types

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

TypeScript interfaces for the Hacker News API

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.