3 ms·
Why is the recommended javascript way of doing it var fso = new ActiveXObject("Scripting.FileSystemObject"); rather than var fs = require('fs') // (o
by fergie 3y ago
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)
?
- tedunangst 3y agoWindows doesn't ship with node.js.
- deleted 3y ago[deleted]
- casselc 3y agoBecause it’s JScript, which was abandoned prior to ES6.
- thangngoc89 3y agoIt’s JScript. Not JavaScript and definitely not Node.JS
- coldtea 3y agoThe latter is not "javascript" in general, it's just a Node.js (a specific v8 Javascript runtime + native integration and libs like fs bundle) API. And the former windows version is JScript which is an implementation Javascript just using an different name for trademark reasons, but tied to an old version of the JavaScript standard (which is confusingly called "ecmascript" officially), plus some Windows-specific integrations, like ActiveXObject and COM/OLE support. (There's also a later .NET version of JScript to add to the confusion).
- vbitz 3y agoBecause JScript was introduced back in Windows 98 and the modern APIs were introduced 10 years later (in the case of Node.js).