# @reteps/dockerfmt

> Bindings around the Golang `dockerfmt` tooling. It compiles the Go code to WebAssembly (using standard Go's `GOOS=js GOARCH=wasm` target), which is then used in the JS bindings.

Latest version **0.5.4** (published 2026-06-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @reteps/dockerfmt
pnpm add @reteps/dockerfmt
yarn add @reteps/dockerfmt
bun add @reteps/dockerfmt
```

Provides the command `dockerfmt`.

## Health

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

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

Warnings: low downloads; no types; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.5.4 |
| Published | 2026-06-27 |
| First published | 2025-04-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | ^v12.20.0 \|\| ^14.13.0 \|\| >=16.0.0 |
| Dependencies | 0 |
| Unpacked size | 6.9 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 615 |
| Author | Peter Stenger |
| Maintainers | reteps |

## Links

- npm: https://www.npmjs.com/package/@reteps/dockerfmt
- Repository: https://github.com/reteps/dockerfmt
- Homepage: https://github.com/reteps/dockerfmt#readme
- Issues: https://github.com/reteps/dockerfmt/issues
- npm.io page: https://npm.io/package/@reteps/dockerfmt

## Recent versions

- 0.5.4 (latest) — 2026-06-27
- 0.5.3 — 2026-06-27
- 0.5.2 — 2026-04-06
- 0.5.1 — 2026-04-06
- 0.5.0 — 2026-04-06
- 0.3.6 — 2025-04-18
- 0.3.5 — 2025-04-11
- 0.3.4 — 2025-04-10
- 0.3.3 — 2025-04-10
- 0.3.2 — 2025-04-09
- 0.3.1 — 2025-04-09
- 0.3.0 — 2025-04-09
- 0.2.8 — 2025-04-09
- 0.2.7 — 2025-04-09
- 0.2.6 — 2025-04-09
- … 6 more at https://npm.io/package/@reteps/dockerfmt/versions

## README

# `@reteps/dockerfmt`

Bindings around the Golang `dockerfmt` tooling. It compiles the Go code to WebAssembly (using standard Go's `GOOS=js GOARCH=wasm` target), which is then used in the JS bindings.

```js
import { formatDockerfile } from '@reteps/dockerfmt'
// Alternatively, you can use `formatDockerfileContents` to format a string instead of a file.

const result = await formatDockerfile('../tests/comment.dockerfile', { indent: 4, trailingNewline: true })

console.log(result)
```

## CLI

The package also ships the `dockerfmt` CLI.

```sh
# Format a Dockerfile and print to stdout
npx @reteps/dockerfmt Dockerfile
```

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