Skip to content

Latest commit

 

History

History

core

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

@kkna/core

npm version npm downloads license

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