I am getting this error:
Unexpected strict mode reserved word
when I am trying to run this code:
"use strict";
var
fs = require('fs'),
spawn = require('child_process').spawn,
filename = process.argv[2];
if(!filename){
throw Error('A File to watch must be specified!');
}
fs.watch(filename,function(){
let ls = spawn('ls',['-lh',filename]);
ls.stdout.pipe(process.stdout);
});
console.log("now watching " + filename + " for changes.....");