0.0.5 • Published 2 years ago

@khaf/magik v0.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

"magik"-ify an image

Implements the popular "magik" image generation that Discord bots have.

Examples

Async version (recommended):

import { Magik } from '@khaf/magik'
import { readFileSync } from 'fs'

const buffer = readFileSync('./image.png')
const magik = new Magik(buffer)

const image = await magik.magikify()

Sync version

The time it takes to magikify an image depends on the image size. This might end blocking the thread for multiple minutes.

import { magikSync } from './index.js'
import { readFileSync } from 'fs'

const buffer = readFileSync('./image.png')
const image = magikSync(buffer)