https://github.com/tuckn/node-wsh-packager
Packaging WSH scripts that are defined in a Windows Script File(.wsf).
https://github.com/tuckn/node-wsh-packager
cli compress jscript minify nodejs npm package windows wsf wsh
Last synced: 12 months ago
JSON representation
Packaging WSH scripts that are defined in a Windows Script File(.wsf).
- Host: GitHub
- URL: https://github.com/tuckn/node-wsh-packager
- Owner: tuckn
- License: mit
- Created: 2019-11-02T00:17:14.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-07-07T21:40:18.000Z (over 3 years ago)
- Last Synced: 2025-03-10T06:17:44.103Z (about 1 year ago)
- Topics: cli, compress, jscript, minify, nodejs, npm, package, windows, wsf, wsh
- Language: JavaScript
- Homepage: https://assets.tuckn.net/docs/node-wsh-packager/
- Size: 458 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Node.js: wsh-packager
Node.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.
## Installation
```console
npm install -g @tuckn/wsh-packager
```
or download a [released binary file](https://github.com/tuckn/node-wsh-packager/releases).
## Usage
```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 A job id to be bundled (Default: "\.(js|vbs|wsf)$").
-D, --base-dir Default is the
-I, --ignore-src Ex. "main\.js$"
-h, --help display help for command
```
### Basic Example
```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.
### Multiple Jobs Packaging
```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"
```
## Documentation
See all specifications [here](https://docs.tuckn.net/node-wsh-packager).
## License
MIT
Copyright (c) 2020 [Tuckn](https://github.com/tuckn)