javascript - How to read the content from a (local) file with SpiderMonkey on the command line? -


I want to use Spidemoke for driving a test harness (see for in-browser version). Now, I tried the following:

  var defaultFileName = "all.n3"; Var Reader = New FileReader (); Reader.readAsText (defaultFileName); Reader.onload = fileloaded;  

that fails with the following error:

  regression-tests.js: 9: reference error: file reader is not defined  

Sorry if this is a silent question, but I had been looking around and for the time being at RTFMD, but it was not able to understand what to do (import? How?).

snap , which reads a file in a string For our (weirdly named function) - the history of that name is not sure). This is a separate API available in the browser, because Shell is considered as the lowest JS performance engine.


Comments