CLI tool that uploads text to hastebin. (Basically a Node.js version of haste-client)
To install this package globally using NPM, run:
npm install -g hastebin
To try this package out before you install, try npx hastebin
.
To install this package locally, try npm i hastebin
. You can then access the hastebin
client via NPM scripts.
$ hastebin --help
Usage: <other-command> | hastebin
or: hastebin [file]
Examples:
echo "Hello" | hastebin upload text from stdin
hastebin text.txt upload text from a file
Options:
-r, --raw Output the link to the raw text
-h, --help Show help
$ echo "hi" | hastebin
http://hastebin.com/ilitixevat
var hastebin = require('hastebin')
hastebin.createPaste('content for your paste', {
raw: true,
contentType: 'text/plain',
server: 'https://hastebin.com'
}, /* options for the 'got' module here */ {})
.then(function (urlToPaste) {})
.catch(function (requestError) {})
By default, hastebin will point to http://hastebin.com
. You can set the HASTE_SERVER
environment variable to configure this.
alias work_haste="HASTE_SERVER=http://something.com haste"
To compile the source just run npm run build
.
This module is licensed under the MIT license.