Node.js CLI to package WSH scripts that are defined in a Windows Script File (.wsf) into one WSH file.
npm install @tuckn/wsh-packagerNode.js CLI to bundle WSH scripts (.js, .vbs) that are defined in a Windows Script File (.wsf).
WSH is an abbreviation for Windows Script Host.
``console`
npm install -g @tuckn/wsh-packager
or download a released binary file.
`console
> wsh-packager bundle --help
Usage: wsh-packager bundle [options]
Bundles .js, .vbs (WSH scripts) files defined in .wsf file.
Options:
-V, --version output the version number
-J, --job-id
-D, --base-dir
-I, --ignore-src
-h, --help display help for command
`
`console`
D:\MyWshFolder\
├─ Package.wsf
└─ src\
├─ Function.js
├─ Object.js
└─ JSON.js
Package.wsf is
`xml`
and execute the below command.
`console`
> wsh-packager bundle "D:\MyWshFolder"
The result
`console`
D:\MyWshFolder\
├─ Package.wsf
├─ dist\
│ └─ JSON.min.js
└─ src\
├─ Function.js
├─ Object.js
└─ JSON.js
The created _JSON.min.js_ is packed with the three .js files that are minified.
`console`
D:\MyWshFolder\
├─ Package.wsf
└─ src\
├─ CLI.js
├─ Excel.vbs
├─ Function.js
├─ Object.js
├─ JSON.js
└─ Util.vbs
Package.wsf is
`xml`
and execute the below command.
`console`
> wsh-packager bundle "D:\MyWshFolder"
The result
`console`
D:\MyWshFolder\
├─ Package.wsf
├─ dist\
│ ├─ JSON.min.js
│ ├─ MyModule.vbs
│ └─ Run.wsf
└─ src\
├─ CLI.js
├─ Excel.vbs
├─ Function.js
├─ Object.js
├─ JSON.js
└─ Util.vbs
_Run.wsf_ is an executable file on Windows of most versions.
`console``
> cscript //nologo "D:\MyWshFolder\dist\Run.wsf"
See all specifications here.
MIT
Copyright (c) 2020 Tuckn