An open API service indexing awesome lists of open source software.

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).

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)