@steveivy thank @t; I just massaged his impl a bit for use in Node.js.