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 1 You must be signed in to fork a gist
  • Save mderijcke/c25002202920d2b7149e to your computer and use it in GitHub Desktop.
Save mderijcke/c25002202920d2b7149e to your computer and use it in GitHub Desktop.
ES6 stuff
function http_get(url, { sayHi, verbose: v }, userAgent = "Kitchen sink 2.0") {
if (sayHi) {
console.log("HI!");
}
if (v) {
console.log("Sending request");
}
return require('http').get({
url,
headers: {
"User-Agent": userAgent
}
});
}
// ...
http_get("http://icanhazip.com", { verbose: true, sayHi: false });
@mderijcke
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment