1.0.3 • Published 3 years ago

haster v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

haster

You can switch which haste server you want to this to work for | Read support other haste server

USAGE

Basic

const { haste } = require('haster')

haste('This is a haste done from haster v1.0.0').then(console.log)
Results in the console
Link {
  key: 'dayow',
  url: 'https://hastebin.com/documents',
  extension: '.js',
  link: 'https://hastebin.com/dayow.js',
  status: 200,
}

Uploading a file

const { hasteFile } = require('haster')

hasteFile('./README.md').then(console.log)
Results in the console
Link {
  key: 'jezoc',
  url: 'https://hastebin.com/documents',
  extension: '.md',
  link: 'https://hastebin.com/jezoc.md',
  status: 200,
}

Getting A haste

const { getHaste } = require('haster')

getHaste('jezoc').then((r) => console.log(r))
results in console
~~ contents of the haste

Support other haste server

  • You can Use the option url

Example

  • Using haste.axixbot.cf (my own server hosted by me, not suggested to use) instead of hastebin

Hastebin is unavailable so it will most likely return service unavailable status code (as of writing this) (its okay now)

const { haste } = require('haster')

haste('This is a haste done from haster v1.0.0', { url: 'https://haste.axixbot.cf'}).then(console.log)
  • Done, should log the same thing as before if everything goes okay

Important: Make sure when providing a url, make sure to not put the "/" at the end if the url ex: 'https://hastebin.com/ becomes https://hastebin.com

Support

Get support at my discord server: join server