Skip to content

Built for people who want to own their automations. Join the waitlist for an invite.

Package listing

@kentcdodds/producthunt

src/list-posts.ts

15 lines · 698 B · TypeScript
import { listPosts } from './domain.ts'
import type { ProductHuntListPostsOptions } from './types.ts'

/**
 * List Product Hunt posts with featured, date, topic, and order filters.
 * @param params.featured - When true, only featured hunts.
 * @param params.order - `RANKING` (default), `FEATURED_AT`, `VOTES`, or `NEWEST`.
 * @example
 * import listPosts from 'kody:@kentcdodds/producthunt/list-posts'
 * const page = await listPosts({ featured: true, first: 5 })
 * // => { nodes: [{ name: '...', slug: '...', votesCount: 120 }], pageInfo: { hasNextPage: true } }
 */
export default async function listPostsEntrypoint(params: ProductHuntListPostsOptions = {}) {
	return await listPosts(params)
}