sourcebin-lite

0.0.4 • Public • Published

sourcebin-lite

is a short sweet, easy, and lightweight sourcebin wrapper using nodejs

license

I use the unlicense

docs

1. create

const sourcebin = require("sourcebin-lite");

(async () => {
	// title, code, options
	const url = await sourcebin.create("title", "code", {
		title: "title",
		description: "description",
	});

	console.log(url);
	// returns "https://sourceb.in/key"
})();

2. get_key

const sourcebin = require("sourcebin-lite");

// you just put in the url of the sourcebin
const key = sourcebin.get_key("https://sourceb.in/key");
console.log(key);
// returns "key"

3. get url

const sourcebin = require("sourcebin-lite");

// you can get the key from document 2
const key = "some key";

// default method
const url1 = sourcebin.url(key);
// returns "https://sourceb.in/key"

// short url method
const url2 = sourcebin.url.short(key);
// returns "https://srcb.in/key"
//
// you can also do sourcebin.short_url and it works the same way

// long url method
const url3 = sourcebin.url.long(key);
// returns "https://sourceb.in/key"
//
// you can also do sourcebin.long_url and it works the same way

4. read(get code from sourcebin link)

const sourcebin = require("sourcebin-lite");

const key = "some key";
// get a key in documentation 2

const text = await read(key, { enableLogs: false });
// all of the text content from the files

support/module news and announcements:


Package Sidebar

Install

npm i sourcebin-lite

Weekly Downloads

1

Version

0.0.4

License

unlicense

Unpacked Size

6.84 kB

Total Files

4

Last publish

Collaborators

  • amashi