This npm module can be used to wait for files being created or changed.
npm install --save wait-for-change
wait-for-change my/file my/other/file && do-something-with my/file
var waitForChange = require("wait-for-change");
waitForChange(["my/file", "my/other/file"]).then(doSomethingWithMyFile);