pastegg-wrapper
v0.0.1
Published
A wrapper for paste.gg
Downloads
33
Maintainers
Readme
PasteGG Wrapper
How to use?
Get a paste by id
const { PasteGG } = require("pastegg-wrapper");
let paste = new PasteGG("your api-key");
async function getPaste() {
let pasteInfo = await paste.get("pasteID");
console.log(pasteInfo);
}
getPaste();
Post a new paste
const { PasteGG } = require("pastegg-wrapper");
let paste = new PasteGG("your api-key");
async function postPaste() {
let postPaste = await paste.post({
name: "paste-name",
description: "paste-description",
visibility: "paste-visibility",
expires: "paste-expire-date",
files: [
{
name: "file_1.txt",
content: {
format: "text",
value: "Hello World!",
},
},
],
});
console.log(postPaste);
}
postPaste();
Delete a paste
const { PasteGG } = require("pastegg-wrapper");
let paste = new PasteGG("your api-key");
async function deletePaste() {
let deletePaste = await paste.delete("pasteID");
console.log(deletePaste);
}
deletePaste();