Remove package's dependencies (does not remove package):
brew deps [FORMULA] | xargs brew remove --ignore-dependencies
Remove package:
| const ipfs = require("nano-ipfs-store").at("https://ipfs.infura.io:5001"); | |
| (async () => { | |
| const doc = JSON.stringify({ | |
| foo: "bar", | |
| tic: "tac" | |
| }); | |
| const cid = await ipfs.add(doc); | 
| const Web3 = require('web3') | |
| const Tx = require('ethereumjs-tx').Transaction | |
| // connect to Infura node | |
| const web3 = new Web3(new Web3.providers.HttpProvider('https://mainnet.infura.io/INFURA_KEY')) | |
| // the address that will send the test transaction | |
| const addressFrom = '0x1889EF49cDBaad420EB4D6f04066CA4093088Bbd' | |
| const privateKey = new Buffer('PRIVATE_KEY', 'hex') | 
| 'use strict' | |
| // ideal for use with AWS Lambda and native Node.js modules | |
| // requires Docker: https://docs.docker.com/engine/installation/ | |
| /* | |
| Usage: | |
| node docker-npm.js install | |
| node docker-npm.js rebuild | 
| 'use strict'; | |
| // When selecting the fn, you have two ways to call it: | |
| // "Event" - asynchronous invocation | |
| // "RequestResponse" - Logs the return value (maybe does more, but it cares about the return value, at the very least) | |
| exports.handler = (event, context, callback) => { | |
| /* | |
| event: | |
| { Records: [{eventSource: 'aws:ses', eventVersion: '1.0', ses: <EMAIL>}]} | |
| https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html | 
This is a basic collection of things I do when setting up a new headless ubuntu machine as a webserver. Following the steps below should give you a reasonable secure server with HTTP/2 support (including ALPN in chrome) and the fast NGINX server. I am happy to add things so leave a comment.
After creating the server (droplet on DigitalOcean) log in with
| # Plain Ol' Node | |
| node --max-old-space-size=1024 app.js # increase to 1gb | |
| node --max-old-space-size=2048 app.js # increase to 2gb | |
| node --max-old-space-size=3072 app.js # increase to 3gb | |
| node --max-old-space-size=4096 app.js # increase to 4gb | |
| node --max-old-space-size=5120 app.js # increase to 5gb | |
| node --max-old-space-size=6144 app.js # increase to 6gb | |
| # For pm2 | |
| pm2 start app.js --node-args="--max-old-space-size=1024" # increase to 1gb |