Newton's Preposterous Miscalculation
Wondering what’s next for npm?Check out our public roadmap! »

pastebin-tsTypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

pastebin-ts

NPM Build Status DAVID npm version Development Dependency Status Code Climate

Typescript version of the Pastebin API client

Features

  • 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

Example

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 succesfully pasted it. Data contains the id
        console.log(data);
    })
    .catch((err) => {
        console.log(err);
    });

Keywords

Install

npm i pastebin-ts

DownloadsWeekly Downloads

33

Version

1.2.0

License

MIT

Unpacked Size

65.7 kB

Total Files

28

Last publish

Collaborators

  • avatar