Last active
August 29, 2015 14:12
-
-
Save prodev247/9d2eb926548f0e29e76e to your computer and use it in GitHub Desktop.
ES6 stuff transpiled
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
function http_get(url, _ref, userAgent) { | |
if (userAgent === undefined) userAgent = "Kitchen sink 2.0"; | |
var sayHi = _ref.sayHi; | |
var v = _ref.verbose; | |
if (sayHi) { | |
console.log("HI!"); | |
} | |
if (v) { | |
console.log("Sending request"); | |
} | |
return require("http").get({ | |
url: url, | |
headers: { | |
"User-Agent": userAgent | |
} | |
}); | |
} | |
// ... | |
http_get("http://icanhazip.com", { verbose: true, sayHi: false }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment