Node.js filesystem module based on events