Reimplement with node.js API.