@kkna/core
v0.0.4
Published
<!-- automd:badges color="gray" license -->
Downloads
9
Readme
@kkna/core
The core engine of KKna without any presets.
Usage
process
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)
definePreset
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 },
}))
}))
License
MIT