Package Exports
- sourcebin
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sourcebin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Sourcebin
This wrapper is designed to easily create and get bins from sourcebin. You are also able to shorten the sourcebin links.
Install
npm install sourcebin --save
Setup
const sourcebin = require('sourcebin');
Create a bin
sourcebin.create([ bin-objects ])
sourcebin.create([
{
content: 'This bin was made using npmjs.org/sourcebin',
languageId: 'text'
}
]).then(console.log)
.catch(console.error);
Get a bin
Syntax:
sourcebin.get("key or sourcebin url")
Example:
sourcebin.get("62cbad45ff")
.then(console.log)
.catch(console.error);
Shorten
Syntax:
sourcebin.shorten("key or sourcebin url")
Example:
var shortLink = sourcebin.shorten("62cbad45ff");
Output
Sample output for the get and create methods:
{
"key": "62cbad45ff",
"url": "https://sourceb.in/62cbad45ff",
"raw": "https://sourceb.in/raw/62cbad45ff",
"short": "http://srcb.in/62cbad45ff",
"created": "2020-04-25T20:32:28.462Z",
"files": [
{
"languageId": 372,
"language": {
"name": "Text",
"extension": "txt",
"aliases": [
"fundamental"
],
"aceMode": "text"
},
"content": "This bin was made using npmjs.org/sourcebin"
}
]
}
Sample output for the shorten method:
http://srcb.in/62cbad45ff
Support
You can message me on discord: GHOST#7524
or create a issue on the github