0.1.5 • Published 11 years ago
pasteall v0.1.5
Pasteall (for node.js)
A little interface to pasteall.org -- the world's best pastebin.
Installation
Just install with NPM, it's that easy.
npm install pasteallExample
It'll (hopefully) be the simplest thing you use today. You pass in the code/text you want to paste, and optionally, a language.
var pasteall = require("pasteall");
var code = "function(foo,bar,quux){\n console.log('foothousandthree');\n}";
var language = "javascript";
pasteall.paste(code,language,function(err,url){
if (!err) {
console.log("resulting url of paste:",url);
} else {
console.log("pasteall errored: ",err);
}
});Or, without a language specified.
var pasteall = require("pasteall");
var code = "function(foo,bar,quux){\n console.log('foothousandthree');\n}";
pasteall.paste(code,function(err,url){
if (!err) {
console.log("resulting url of paste:",url);
} else {
console.log("pasteall errored: ",err);
}
});Detailed Usage
pasteall.paste(code_or_text, language, callback(err,resulting_url))
code_or_textis the code or text you'd like to pastelanguageIs the language you'd like this highlighted as optionalcallbackwhen finished returns error as first argument, or resulting URL as second when successful.
Regarding the list of languages, here's some common ones:
javascriptphpmysqlrubyhaskellcpp
You can check out pasteall.org and view the drop-down for a long list. Or, checkout pasteall.js herein.