bnoordhuis/node@59430ac for an example. Feel free to steal.