0.0.1 • Published 3 years ago

@jeremyx9/hastebin v0.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Pastebin.js

How to start

First of all you have to download the package with npm install @jeremyx9/hastebin.js

include the hastebin.js module

const Hastebin = require("@jeremyx9/hastebin");

create a paste variable to configure options and create a paste

const paste = new Hastebin();

create a paste and get the associated key for the paste

async function createPaste() {
    const url = await paste.newPaste("$world = new World();");
    console.log(url); // egasiwulog -> you can set the url before (https://www.toptal.com/developers/hastebin/egasiwulog)
}

get paste with key

async function getPaste() {
    const data = await paste.getPaste("egasiwulog");
    console.log(data); // $world = new World();
}

Thats it!