1 | /**
|
2 | * This package provides a TypeScript client for the Hacker News API.
|
3 | *
|
4 | * @remarks
|
5 | *
|
6 | * @example
|
7 | * Get the ID of the latest item created on HN:
|
8 | *
|
9 | * ```typescript
|
10 | * import { getMaxItemId } from 'hn-ts';
|
11 | *
|
12 | * (async () => {
|
13 | * const id = await getMaxItemId();
|
14 | *
|
15 | * // Output: a number like `27107832`
|
16 | * console.log(id);
|
17 | * })();
|
18 | * ```
|
19 | *
|
20 | * @example
|
21 | * Get the item (story, comment, job, poll or poll option) with the given ID:
|
22 | *
|
23 | * ```typescript
|
24 | * import { getItemById } from 'hn-ts';
|
25 | *
|
26 | * (async () => {
|
27 | * const item = await getItemById({
|
28 | * id: 27107832,
|
29 | * });
|
30 | *
|
31 | * // Output: `27107832`
|
32 | * console.log(item.id);
|
33 | *
|
34 | * // Output: `story`
|
35 | * console.log(item.type);
|
36 | *
|
37 | * // Output: `velut`
|
38 | * console.log(item.author);
|
39 | * })();
|
40 | * ```
|
41 | *
|
42 | * @example
|
43 | * Get the user with the given name:
|
44 | *
|
45 | * ```typescript
|
46 | * import { getUserById } from 'hn-ts';
|
47 | *
|
48 | * (async () => {
|
49 | * const user = await getUserById({
|
50 | * id: "velut",
|
51 | * });
|
52 | *
|
53 | * // Output: `velut`
|
54 | * console.log(user.id);
|
55 | * })();
|
56 | * ```
|
57 | *
|
58 | * @see {@link https://news.ycombinator.com/}
|
59 | * @see {@link https://github.com/HackerNews/API}
|
60 | *
|
61 | * @packageDocumentation
|
62 | */
|
63 |
|
64 | export * from "./get-ask-stories-ids";
|
65 | export * from "./get-best-stories-ids";
|
66 | export * from "./get-item-by-id";
|
67 | export * from "./get-job-stories-ids";
|
68 | export * from "./get-latest-item-and-user-updates";
|
69 | export * from "./get-max-item-id";
|
70 | export * from "./get-new-stories-ids";
|
71 | export * from "./get-raw-item-by-id";
|
72 | export * from "./get-raw-user-by-id";
|
73 | export * from "./get-show-stories-ids";
|
74 | export * from "./get-top-stories-ids";
|
75 | export * from "./get-user-by-id";
|
76 | export * from "./hn-api-base-url";
|
77 | export * from "./item";
|
78 | export * from "./item-type";
|
79 | export * from "./raw-item";
|
80 | export * from "./raw-item-type";
|
81 | export * from "./raw-user";
|
82 | export * from "./updated";
|
83 | export * from "./user";
|