Why is the recommended javascript way of doing it
var fso = new ActiveXObject("Scripting.FileSystemObject");
rather than var fs = require('fs') // (or the appropriate ES6 incantation)
?