This is a Node.js libary that runs Windows Scripting Host (WSH) as a child process and exposes the resources from the WSH world to the Node.js world through serialized communication over the standard input and output channels. Obviously, it only works on Windows.
To install:
$ npm install @arcticnotes/node-wshIn JavaScript code:
import {WindowsScriptingHost} from '@arcticnotes/node-wsh';
const WSH = await WindowsScriptingHost.connect();
const WScript = WSH.global( 'WScript');
console.log(WScript.Version);
await WSH.disconnect();- Node.js release 20.x or higher is required.
- Windows Scripting Host is required. Version compatibility is unclear. Please report issues.
- Version 5.812 is known to work.
- Dependency libraries included by
package.json:@arcticnotes/syncline. See https://github.com/arcticnotes/syncline.
This library is shared under the MIT License. See the LICENSE file for details.
This library includes json2.js, an implementation of JSON, donated by Douglas Crockford (the designer of JSON) to the
public domain. The license aforementioned does not apply to this file.