# jest-transform-pug

> A Jest transform that compiles .pug files as templates

Latest version **1.0.1** (published 2025-06-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install jest-transform-pug
pnpm add jest-transform-pug
yarn add jest-transform-pug
bun add jest-transform-pug
```

## Health

**Score 40/100 (D)** — status: stable.

Positive: no vulnerabilities; high maintenance score.

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

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2025-06-03 |
| First published | 2018-02-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | quentinroy |
| Keywords | pug, jest, transform, template |

## Links

- npm: https://www.npmjs.com/package/jest-transform-pug
- Repository: https://github.com/QuentinRoy/jest-transform-pug
- Homepage: https://github.com/QuentinRoy/jest-transform-pug#readme
- Issues: https://github.com/QuentinRoy/jest-transform-pug/issues
- npm.io page: https://npm.io/package/jest-transform-pug

## 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

- 1.0.1 (latest) — 2025-06-03
- 1.0.0 — 2024-03-03
- 0.1.0 — 2018-02-22
- 0.1.0-beta.0 — 2018-02-22

## README

# jest-transform-pug

[![NPM](https://img.shields.io/npm/v/jest-transform-pug.svg)](https://www.npmjs.com/package/jest-transform-pug)

A [Jest](https://github.com/facebook/jest) transform that compiles your
[.pug](https://github.com/pugjs/pug) files as template functions just like your
pug loader would (e.g [rollup-plugin-pug](https://github.com/aMarCruz/rollup-plugin-pug)
or [pug-loader](https://github.com/pugjs/pug-loader)).

## Usage

```
npm install jest-transform-pug --save-dev
```

## Setup

Define `jest-transform-pug` as a transformer for Jest, by adding
the following to your Jest configuration in your `package.json`:

```json
{
  "jest": {
    "transform": {
      "\\.(pug)$": "jest-transform-pug"
    }
  }
}
```

Warning, this would override default transforms automatically set up by jest.
Hence, if you rely on e.g., babel transpilation in your tests, you will need
to set up babel jest as well:

```json
{
  "jest": {
    "transform": {
      "^.+\\.jsx?$": "babel-jest",
      "\\.(pug)$": "jest-transform-pug"
    }
  }
}
```

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