Skip to content

Uploader/Shortener module for Elixire Instances

Notifications You must be signed in to change notification settings

fangmarks/elixire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

elixi.re uploader/shortener by hokkqi

this is a module for the main elixire instance as well as self-hosted instances

import Elixire from "elixire"; 
// OR 
let Elixire = require("elixire");

let Uploader = new Elixire({
  instance_url: "<Instance URL here>",// optional, defaults to elixi.re
  apikey: "<API Key here>", // needed
});

let File = fs.readFileSync("./404.png"); // or another way to get the Buffer of an Image
let URL = "https://himbo.cat";

Uploader.Upload({ buffer: File }).then((r) => console.log(r));
/* 
returns {
    url: string,
    shortlink: string,
    delete_url: string
}
*/
Uploader.Shorten({ url: URL }).then((r) => console.log(r));
/* 
returns {
    url: string
}
*/