Simple NodeJS API wrapper for sxcu.net.
sxcu.js is a simple NodeJS API wrapper for sxcu.net API.
Run npm i sxcu.js
in your project folder. That's it lmao.
-
Covers all the endpoints of SXCU API.
-
Object oriented.
-
That's it!
Here are a few examples to help you understand the wrapper.
const SXCUjs = require('sxcu.js'); // require the module.
const image = new SXCUjs.Image('https://sxcujs.is-ne.at/upload', 'Your very secret upload token'); // Construct the image.
image.attachFile('your image.png'); // Attach the image.
image.upload() // Upload the image.
.then(uploadedImg => {
console.log(`Upload URL: ${uploadedImg.getUrl()}`); // https://sxcujs.is-ne.at/qbu8Cp
})
.catch(console.error) // Print the error if thrown any while uploading the image.
const SXCUjs = require('sxcu.js'); // require the module.
let text = `Phoenix852 is a noob.`; // Yeah I am a noob.
SXCUjs.createPaste(text)
.then((paste) => {
console.log(paste.getUrl()); // https://cancer-co.de/rOSaX
})
.catch(console.error) // Print the error if there are any while creating the paste.
const SXCUjs = require('sxcu.js'); // require the module.
let link = "https://linktr.ee/phoenix852"; // Yeah a shameless self promotion :P
SXCUjs.shortenLink(link) // Shorten the link.
.then(shortenedLink => {
console.log(shortenedLink.getUrl()); // https://questionable.link/JJK1EPc
})
.catch(console.error) // Print the error if there are any while shortening the link.
Useful links you might want to check out.
Before creating an issue, please make sure to read the docs once. If you still want to create an issue, you are welcome over here.