1.1.0 • Published 4 years ago
rambin v1.1.0
Installation
npm i --save rambin
Usage
Option 1
const RamBin = require("rambin");
const bin = new RamBin();
bin.create({
code: "let hello = 'world';",
lang: "JavaScript", //View the available languages and delete in dates here: https://rambin.tk
delIn: "2h"
})
.then(url => console.log(url)) //Might look something like: https://rambin.tk/zylu87f1hhe0.js
.catch(err => console.log(err));
- rambin
create(options) ⇒ {Promise}
Param | Type | Description |
---|---|---|
code | string | The code to be displayed in the bin (required ) |
lang | string | The language of the code (optional | default: text ) |
delIn | string | The time of bin demolishment (optional | default: 2h ) |
Option 2
const RamBin = require("rambin");
const bin = new RamBin();
bin.get({
id: "zylu87f1hhe0",
type: "json" //raw
})
.then(body => console.log(body))
.catch(err => console.log(err));
JSON output:
{
"id": "zylu87f1hhe0",
"code": "let hello = 'world';",
"lang": "text",
"created": 1585314645635
}
RAW output:
let hello = 'world';
- rambin
- get(options) ⇒ {Promise}
Param | Type | Description |
---|---|---|
id | string | The id of the requested bin (required ) |
type | string | The type of information to request (optional | types: 'raw' & 'json' ) |
Option 3 - UNDER DEVELOPMENT (coming in any future versions)
const RamBin = require("rambin");
const bin = new RamBin();
bin.getMyBins({
userID: "303586677484003840"
})
.then(bins => console.log(bins)) //OUTPUT: redirect link or array of redirect links
.catch(err => console.log(err));
- rambin
- getMyBins(option) ⇒ {Promise}
Param | Type | Description |
---|---|---|
userID | string | The id of the discord user (required ) not sure what this means? |