hastebin-gen
A npm module for generating hastebin links. https://www.npmjs.com/package/hastebin-gen
Installation
NPM: npm i hastebin-gen
Yarn: yarn add hastebin-gen
Options
Option | Type | Default Value |
---|---|---|
url |
string |
"https://hastebin.com" |
extension |
string |
"js" |
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