#!/usr/bin/env bash
nohup mongod --auth --dbpath data/db/ --logpath log/log.txt --rest > log/nohup.out 2>&1 &
Author: Casey Duncan @iamnotcasey
This Javascript constructor with inheritance pattern is designed as a lightweight alternative to other methods I've seen while still providing a nice abstraction as a 13 line function that can be easily inlined into your code.