Skip to content

Instantly share code, notes, and snippets.

@mderijcke
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mderijcke/9d2eb926548f0e29e76e to your computer and use it in GitHub Desktop.
Save mderijcke/9d2eb926548f0e29e76e to your computer and use it in GitHub Desktop.
ES6 stuff transpiled
"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