# vbspretty

> A VBScript parser and beautifier

Latest version **0.0.3** (published 2021-07-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install vbspretty
pnpm add vbspretty
yarn add vbspretty
bun add vbspretty
```

Provides the command `vbspretty`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2021-07-13 |
| First published | 2021-07-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 56 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Lenilson de Castro |
| Maintainers | lenilsondc |
| Keywords | vbs, vbscript, parser, beautifier, formatter |

## Links

- npm: https://www.npmjs.com/package/vbspretty
- Repository: https://github.com/lenilsondc/vbspretty
- Homepage: https://github.com/lenilsondc/vbspretty#readme
- Issues: https://github.com/lenilsondc/vbspretty/issues
- npm.io page: https://npm.io/package/vbspretty

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2021-07-13
- 0.0.2 — 2021-07-13
- 0.0.1 — 2021-07-13

## README

# vbspretty [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/lenilsondc/vbspretty/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/vbspretty.svg?style=flat)](https://www.npmjs.com/package/vbspretty) 

A sophisticated VBScript parser and beautifier powered by nodejs.

## Usage

```shell
npm i vbspretty
```
As command-line (See command line options at [CLI](#cli-usage))

```shell
npx vbspretty ./MyApp.vbs
```

### Nodejs usage

```js
const fs = require('fs');
const vbspretty = require('vbspretty');

const source = fs.readFileSync('./MyApp.vbs').toString();

var sourcePretty = vbspretty({
  level: 0,
  indentChar: '\t',
  breakLineChar: '\r\n',
  breakOnSeperator: false,
  removeComments: false,
  source: source,
});

fs.writeFileSync('./MyAppPretty.vbs', sourcePretty);
```

### CLI usage

Cli accepts all options from the [api](#api) plus an `--output` option to provide a different file to output formatted version, if `--output` is omitted, the input file will be overwritten.

First param should always be the input file and it's mandatory, other params are optionals to configure vbspretty options. See full example bellow.

```shell
vbspretty MyApp.vbs --level 0 --indentChar "\t" --breakLineChar "\r\n" --breakOnSeperator --removeComments --output ./MyAppPretty.vbs
```

## API

|Options|Type|Default|Description|
|---|---|---|---|
|level|`number`|`0`|Indent level to start off|
|indentChar|`String`| "<kbd>space</kbd><kbd>space</kbd>"|Indent character (e.g., `\t`, <kbd>space</kbd><kbd>space</kbd>)|
|breakLineChar|`String`|`"\n"`| Break line character (e.g., `\n`, `\r\n`)|
|breakOnSeperator|`boolean`|`false`| Whether it breaks the line on occurrences of the `":"` statement separator.|
|removeComments|`boolean`|`false`|Whether it removes comments from the input.|

---
_Source: https://npm.io/package/vbspretty · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
