# kirby-template-sugar

Latest version **1.1.4** (published 2026-07-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install kirby-template-sugar
pnpm add kirby-template-sugar
yarn add kirby-template-sugar
bun add kirby-template-sugar
```

Provides the command `kirby-template-sugar`.

## Health

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

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

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2026-07-30 |
| First published | 2023-04-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 56.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 43 |
| Maintainers | arnoson |

## Links

- npm: https://www.npmjs.com/package/kirby-template-sugar
- Repository: https://github.com/arnoson/kirby-template-sugar
- npm.io page: https://npm.io/package/kirby-template-sugar

## Dependencies (4)

- [cac](https://npm.io/package/cac.md) ^7.0.0
- [glob](https://npm.io/package/glob.md) ^13.0.6
- [chokidar](https://npm.io/package/chokidar.md) ^3.6.0
- [magic-string](https://npm.io/package/magic-string.md) ^1.1.0

## Recent versions

- 1.1.4 (latest) — 2026-07-30
- 1.1.3 — 2026-07-30
- 1.0.0 — 2025-08-07
- 0.4.4 — 2025-07-03
- 0.4.3 — 2025-07-02
- 0.4.2 — 2025-04-10
- 0.4.1 — 2025-02-14
- 0.4.0 — 2025-02-13
- 0.3.2 — 2025-02-07
- 0.3.1 — 2023-12-04
- 0.3.0 — 2023-11-24
- 0.2.5 — 2023-09-25
- 0.2.4 — 2023-08-15
- 0.2.3 — 2023-07-28
- 0.2.2 — 2023-07-28
- … 10 more at https://npm.io/package/kirby-template-sugar/versions

## README

# Kirby Template Sugar

## CLI Usage

No need to install the package, just run it with `npx`.

### Build

Compile all files inside `site/templates` and `site/snippets` into `site/dist`.<br>
Note: we're using `site` as the root folder, so the other paths will be relative to it.

```bash
npx kirby-template-sugar "{templates,snippets}/*.kirby" --root site --outDir dist
```

### Development

Same as [build](#build) but with the `--watch` flag

```bash
npx kirby-template-sugar "{templates,snippets}/*.kirby" --root site --outDir dist --watch
```

## Manual Usage

Install the package with

```bash
npm i kirby-template-sugar -D
```

and then

```ts
import { transform, transformFiles, watchFiles } from 'kirby-template-sugar'

const options = { root: 'src', outDir: 'dist' }

// either watch files
watchFiles('**/*.kirby', options)

// or compile them once
transformFiles('**/*.kirby', options)

// or compile a string
const result = transform(`<k:test $prop="<? true ?>" />`)
```

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