Skip to content

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

Package listing

@kentcdodds/producthunt

src/list-comments.ts

15 lines · 662 B · TypeScript
import { listComments } from './domain.ts'
import type { ProductHuntListCommentsOptions } from './types.ts'

/**
 * List comments on a Product Hunt post.
 * @param params.slug - Post slug when `postId` is not available.
 * @param params.order - `NEWEST` (default) or `VOTES_COUNT`.
 * @example
 * import listComments from 'kody:@kentcdodds/producthunt/list-comments'
 * const page = await listComments({ slug: 'clara-ai-sdr', first: 10 })
 * // => { nodes: [{ body: '...', votesCount: 4 }], pageInfo: { hasNextPage: false } }
 */
export default async function listCommentsEntrypoint(params: ProductHuntListCommentsOptions) {
	return await listComments(params)
}