Skip to content

j3lte/pastebin-ts

Repository files navigation

pastebin-ts

*********** 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 ***********

NPM Libraries.io dependency status for GitHub repo master npm version npm Code Climate codecov

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

About

Typescript version of pastebin-js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages