The core engine of KKna without any presets.
import { process } from '@kkna/core'
import { mastodon } from '@kkna/preset-mastodon'
const result = await process({
data: { ...data },
presets: [
mastodon({
// https://fosstodon.org/@importantimport/111211120931974745
id: '111211120931974745',
instance: 'https://fosstodon.org',
}),
...presets,
],
})
/** @type {import('@kkna/core').ProcessResult} */
console.log(result)
import { definePreset, definePresetTask } from '@kkna/core'
export interface Options {
/* your options here */
}
export const example = definePreset<Options>(options => ({
name: 'example', // kkna-preset-example => example
options,
task: definePresetTask(async data => ({
comments: { ...comments },
reactions: { ...reactions },
}))
}))
MIT