# @nsis/dent

> An opinionated code formatter for NSIS scripts

Latest version **0.17.0** (published 2026-09-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @nsis/dent
pnpm add @nsis/dent
yarn add @nsis/dent
bun add @nsis/dent
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.17.0 |
| Published | 2026-09-24 |
| First published | 2023-05-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=20.0.0 |
| Dependencies | 1 |
| Unpacked size | 45.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | idleberg |
| Keywords | nsis, formatter |

## Links

- npm: https://www.npmjs.com/package/@nsis/dent
- Repository: https://github.com/idleberg/nsis-org
- Homepage: https://github.com/idleberg/nsis-org/tree/main/packages/dent#readme
- npm.io page: https://npm.io/package/@nsis/dent

## Dependencies (1)

- [@nsis/parser](https://npm.io/package/@nsis/parser.md) 0.2.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.17.0 (latest) — 2026-09-24
- 0.16.1 — 2026-09-18
- 0.16.0 — 2026-08-25
- 0.15.0 — 2026-08-23
- 0.14.1 — 2026-08-16
- 0.14.0 — 2026-08-15
- 0.13.1 — 2026-07-30
- 0.13.0 — 2026-06-21
- 0.12.3 — 2026-06-04
- 0.12.2 — 2026-06-04
- 0.12.1 — 2026-06-01
- 0.12.0 — 2026-05-30
- 0.11.2 — 2026-05-29
- 0.11.1 — 2026-05-26
- 0.11.0 — 2026-05-25
- … 23 more at https://npm.io/package/@nsis/dent/versions

## README

# @nsis/dent

> An opinionated code formatter for NSIS scripts

![License](https://img.shields.io/npm/l/%40nsis%2Fdent?style=for-the-badge)
[![Version](https://img.shields.io/npm/v/@nsis/dent?style=for-the-badge)](https://www.npmjs.org/package/@nsis/dent)
[![Build](https://img.shields.io/github/actions/workflow/status/idleberg/nsis-org/ci.yml?style=for-the-badge)](https://github.com/idleberg/nsis-org/actions)

> [!NOTE]  
> This is the repository for the formatting library powering the ~~[Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=idleberg.nsis) and~~ [Pulsar](https://packages.pulsar-edit.dev/packages/language-nsis) packages. Chances are you were looking for the [CLI tool](https://github.com/idleberg/nsis-org/tree/main/packages/dent-cli).

[Demo Time](https://idleberg.github.io/nsis-org/dent/) 🙌

## Installation

`npm install @nsis/dent`

## Usage

```ts
import { createFormatter } from "@nsis/dent";

const { format } = createFormatter(/* user options */);

format(`
	# Look ma, no indentation
	Name "Demo"
	Section
	Nop
	SectionEnd
`);
```

Output of the script above:

```nsis
# Look ma, no indentation
Name "Demo"

Section
	Nop
SectionEnd
```

### API

#### `format(fileContents)`

Formats the given NSIS code and returns the result as a string.

#### `check(fileContents)`

Returns `null` if the file is already formatted, otherwise the formatted string.

### Options

#### `options.commentStyle`

Type: `"hash" | "semi"`  
Default: *none*

NSIS accepts both `#` and `;` for single-line comments. By default every comment keeps the marker it was written with. Set this option to unify them — `"hash"` rewrites `; comment` to `# comment`, `"semi"` does the reverse. Block comments (`/* … */`) are never touched.

#### `options.endOfLine`

Type: `"crlf" | "lf"`  
Default: `"crlf"` (Windows), `"lf"` (Linux, macOS)

#### `options.indentSize`

Type: `number`  
Default: `2`

#### `options.trimEmptyLines`

Type: `boolean`  
Default: `true`

#### `options.printWidth`

Type: `numbers`  
Default: `0`

#### `options.singleQuote`

Type: `boolean`  
Default: `false`

#### `options.useTabs`

Type: `boolean`  
Default: `true`

:white_check_mark: [Why defaulting to tabs is good for accessibility](https://github.com/prettier/prettier/issues/7475#issuecomment-668544890)

## Related

- [dent-cli](https://www.npmjs.com/package/@nsis/dent-cli)
- [dent-desktop](https://github.com/idleberg/dent-desktop/)
- [ardent](https://crates.io/crates/ardent)

## License

This work is licensed under [The MIT License](LICENSE).

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