hastebin-paste
A npm module for generating hastebin links. https://www.npmjs.com/package/hastebin-paste
change log
[1.2.5]Status deleted since it is not working, message after the link was added. See readme for more info
[1.1.6]Default Extension changed to txt file
[1.1.4]Status officially published
[1.1.1, 1.1.2, 1.1.3]Fixed Bugs
[1.1.0]New option: status
[1.0.5]error return updated: make it easier for people to debug, keyword updated
[1.0.4]Keyword updated
[1.0.1, 1.0.2 and 1.0.3]README updated
[1.0.0]initial publish
Installation
NPM: npm i hastebin-paste
Options
Option | Type | Default Value |
---|---|---|
url |
string |
"https://hastebin.com" |
extension |
string |
"txt" |
message |
string |
"Powered by hastebin-paste, a npm package." |
prefix |
string |
"The link is: " |
Examples
Using .then().catch()
const hastebin = ; // You can change the extension by setting the extension option;
Using async/await
This is assuming that you are in a asynchronous scope
const hastebin = ; // You can change the extension by setting the extension optionconst haste = await ; // Logs the created hastebin url to the consoleconsole; // https://hastebin.com/someid.txt
haste-server instance
Example with a customUsing .then().catch()
const hastebin = ; // You can change the extension by setting the extension option;
Using async/await
This is assuming that you are in a asynchronous scope
const hastebin = ; // You can change the extension by setting the extension optionconst haste = await ; // Logs the created hastebin url to the consoleconsole; // https://paste.example.com/someid.txt
Using message and prefix
const hastebin = ; // You can change the extension by setting the extension option;