SourceBin Wrapper
With this wrapper you can create and get bins from https://sourceb.in/
Install
npm i sourcebin-wrapper --save
Initialize
// typescript; // Node/JavaScriptconst SourceBin = ;
Methods
create([BinFile], BinOptions?)
SourceBin ;
Language defaults to Text, if invalid or no language provided.
upload(path, BinOptions?)
// Upload single fileSourceBin ; // Upload entire folderSourceBin ;
Language is detected by the file extension, and name as well.
newBin(contents, lang?, name?, BinOptions?)
SourceBin ;
get(url | key)
// Get bin using its keySourceBin; // Get bin using its urlSourceBin;
Sample Output
Output for both create and get
Options
BinFileOptions:
This is for creating BinFiles
content
: The contents of what you're uploadingname
<optional>: The name of the file to be uploadedlanguageId
<optional>: Language of the contents you're uploading
BinOptions:
This is for creating Bins
title
<optional>: The title of the bindescription
<optional>: The description of the bin
Note: BinFile is for the contents of each Bin. A Bin can contain multiple BinFiles