Skip to content

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

Package listing

@kentcdodds/producthunt

src/list-collections.ts

16 lines · 687 B · TypeScript
import { listCollections } from './domain.ts'
import type { ProductHuntListCollectionsOptions } from './types.ts'

/**
 * List Product Hunt collections with optional post, user, and featured filters.
 * @param params.order - `FEATURED_AT` (default), `NEWEST`, or `FOLLOWERS_COUNT`.
 * @example
 * import listCollections from 'kody:@kentcdodds/producthunt/list-collections'
 * const page = await listCollections({ featured: true, first: 5 })
 * // => { nodes: [{ name: '...', followersCount: 800 }], pageInfo: { hasNextPage: true } }
 */
export default async function listCollectionsEntrypoint(
	params: ProductHuntListCollectionsOptions = {},
) {
	return await listCollections(params)
}