processFile function on generate.js