*********** NOTE ***********
Update 2023-11-22 --- I consider this package to be deprecated. Please install pastedeno for an up to date wrapper for Pastebin! Active development on the current package is halted
*********** NOTE ***********
Typescript version of the Pastebin API client
- getPaste : get a raw paste
- createAPIuserKey : get a userkey for the authenticated user
- listUserPastes : get a list of the pastes from the authenticated user
- getUserInfo : get a list of info from the authenticated user
- listTrendingPastes : get a list of the trending pastes on Pastebin
- createPaste : create a paste
- createPasteFromFile : read a file (UTF8) and paste it
- deletePaste : delete a paste created by the user
const PastebinAPI = require('pastebin-ts');
const pastebin = new PastebinAPI({
'api_dev_key' : 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'api_user_name' : 'PastebinUserName',
'api_user_password' : 'PastebinPassword'
});
pastebin
.createPasteFromFile({
'file': './uploadthistopastebin.txt',
'title': 'pastebin-js test'
})
.then((data) => {
// we have successfully pasted it. Data contains the id
console.log(data);
})
.catch((err) => {
console.log(err);
});