Skip to content

Instantly share code, notes, and snippets.

@ArtskydJ
Created July 30, 2015 15:00
Show Gist options
  • Save ArtskydJ/343fbb490713b5ee797b to your computer and use it in GitHub Desktop.
Save ArtskydJ/343fbb490713b5ee797b to your computer and use it in GitHub Desktop.
var get = require('simple-get')
var got = require('got')
var xhr = require('xhr')
var url = 'http://requirebin.com/lib/html-editor.js'
get.concat(url, exec('get'))
got(url, exec('got'))
xhr(url, exec('xhr'))
function exec(name) {
return function x(e, buf) {
var str = String(buf && buf.body)
console.log(name, e, typeof str, str.slice(0, 10))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment