Skip to content

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

Package listing

@kody/morning-briefing

src/run-morning-briefing.ts

20 lines · 789 B · TypeScript
import { runMorningBriefing, runScheduledMorningBriefing } from './report.ts'
import type { BriefingInput } from './types.ts'

export { runMorningBriefing, runScheduledMorningBriefing }

/**
 * Run the briefing pipeline. With no params, loads stored package config
 * (the same contract the scheduled job uses).
 *
 * @example
 * import run from 'kody:@kody/morning-briefing/run-morning-briefing'
 * const result = await run({ dryRun: true, sources: ['weather'], location: 'Denver, CO' })
 * // => { delivered: false, preview: { subject: '...', text: '...' } }
 */
export default async function runMorningBriefingExport(input: BriefingInput = {}) {
	if (!input || Object.keys(input).length === 0) {
		return await runScheduledMorningBriefing()
	}
	return await runMorningBriefing(input)
}