Make Node.js functions run synchronously