Skip to content

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

Package listing

@kody/stash

src/add.ts

17 lines · 739 B · TypeScript
import { addNote } from './lib/notes.ts'
export { addNote }

/**
 * Add a note, reminder, contact, instruction, or fact to this package's stash.
 *
 * @param input.text - Note body. Hashtags become tags; kind is inferred when omitted.
 * @param input.dryRun - When true, preview the saved shape without writing storage.
 * @returns The saved or previewed note with inferred kind, tags, and entities.
 * @example
 * import addNote from 'kody:@kody/stash/add'
 * const preview = await addNote({ text: 'Garage door code: 1234 #home', dryRun: true })
 * // => { ok: true, dryRun: true, note: { summary: 'Garage door code: 1234', kind: 'note' } }
 */
export default async function addStashNote(input?: unknown) {
	return await addNote(input)
}