Skip to content

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

Package listing

@kentcdodds/producthunt

src/get-topic.ts

13 lines · 481 B · TypeScript
import { getTopic } from './domain.ts'
import type { ProductHuntGetTopicOptions } from './types.ts'

/**
 * Look up a Product Hunt topic by id or slug.
 * @example
 * import getTopic from 'kody:@kentcdodds/producthunt/get-topic'
 * const topic = await getTopic({ slug: 'developer-tools' })
 * // => { id: '...', name: 'Developer Tools', postsCount: 12000 }
 */
export default async function getTopicEntrypoint(params: ProductHuntGetTopicOptions) {
	return await getTopic(params)
}