Package for m1r.ai
pnpm add node-mirai
import { upload, readFile } from 'node-mirai'
const file = readFile(
'./path/to/test.png', // './path/to/test.mp4'
)
const { url } = await upload(
file,
{
headers: { Referrer: 'test-image', CustomHeader: 'test' }
}
)
console.log(url)
Accept type File
, so you have to create a file object first
Optional, alias from node fetch()
options
equired, path to file