1.0.2 • Published 4 years ago
@eversedev/jelbrek.js v1.0.2
jelbrek.js
This is a JavaScript API wrapper for jelbrek.icu written in TypeScript. jelbrek.icu is a image-uploading service.
Examples
import jelbrek from "jelbrek.js";
import fs from "fs";
jelbrek(fs.readFileSync("./image.png"), "png", "example-key")
// Returns: Promise<Response>
Documentation
upload
Parameters: name | type | optional | default ---- | ---- | -------- | ------- image | Buffer | no | - type | ImageType | no | - key | string | no | - expiry | number | yes | account highest
Returns: Promise\<Response>
Response
Type: Object
Properties:
name | type | optional
---- | ---- | --------
success | boolean | no
message | "Success." | yes
url | string | yes
error | ErrorType | yes
ImageType
"png" or "webp" or "jpg"
ErrorType
"No file to upload" or "Authorization header is incorrect." or "Authorization header is not provided."