# jadeify

> A browserify transform for turning .jade files into template functions

Latest version **4.7.0** (published 2017-05-01) · WTFPL license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.7.0 |
| Published | 2017-05-01 |
| First published | 2011-05-28 |
| Weekly downloads | 0 |
| License | WTFPL |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Domenic Denicola |
| Maintainers | substack, oliverjash, guybrush, domenic |
| Keywords | browserify, jade, templates, templating, transform |

## Links

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

## Dependencies (1)

- [through](https://npm.io/package/through.md) ^2.3.6

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 4.7.0 (latest) — 2017-05-01
- 4.6.0 — 2016-01-12
- 4.5.0 — 2015-11-12
- 4.4.0 — 2015-07-19
- 4.3.0 — 2015-05-08
- 4.2.0 — 2015-04-16
- 4.1.0 — 2015-02-21
- 4.0.1 — 2015-02-06
- 4.0.0 — 2015-01-02
- 3.1.0 — 2014-12-07
- 3.0.0 — 2014-10-30
- 2.7.0 — 2014-10-07
- 2.6.0 — 2014-10-05
- 2.5.1 — 2014-08-29
- 2.5.0 — 2014-07-24
- … 13 more at https://npm.io/package/jadeify/versions

## README

# A Browserify Transform for Jade

**Jadeify** lets you use [Jade][] templates with [browserify][] in the simplest way possible:

```js
var template = require("./template.jade");

document.getElementById("my-thing").innerHTML = template({
    localVar: "value",
    anotherOne: "another value"
});
```

## Setup

When creating your browserify bundle, just add this line:

```js
bundle.transform(require("jadeify"));
```

or if you are a command line cowboy, something along the lines of

```js
browserify -t jadeify entry.js -o bundle.js
```

Note that this project peer-depends on Jade and each template will do `require("jade/runtime")`, so everything will just work: there's no need to add any Jade-related stuff to your bundle manually. (See below if your need to customize this.)

So yeah, now `require`ing any `.jade` files will give you back a template function. Have fun!

## Configuration

As with most browserify transforms, you can configure jadeify via the second argument to `bundle.transform`:

```js
bundle.transform(require("jadeify"), { compileDebug: true, pretty: true });
```

or inside your `package.json` configuration:

```json
{
    "name": "my-spiffy-package",
    "browserify": {
        "transform": [
            ["jadeify", { "compileDebug": true, "pretty": true }]
        ]
    }
}
```

Most options given to jadeify will be passed through to [Jade's API][].

### `runtimePath` option

There is one additional option, `runtimePath`, which can be used to customize the `require` statement inserted at the top of every resulting template. If supplied, instead of `require("jade/runtime")`, the given module ID will be required.

This can be useful if you are using jadeify as a dependency in a standalone library. For example, if your package `demo-package` depends on both `jade` and `jadeify`, you can do

```js
bundle.transform(require("jadeify"), { runtimePath: require.resolve("jade/runtime") });
```

inside your package. If your package is then located at `node_modules/demo-package`, and thus its `jade` dependency is located at `node_modules/demo-package/node_modules/jade`, this will ensure that the template files output by your library contain the equivalent of `require("demo-package/node_modules/jade/runtime")`, instead of the default `require("jade/runtime")`. This way your library completely encapsulates the presence of Jade, and doesn't require its installation at top level.

[Jade]: http://jade-lang.com/
[browserify]: https://github.com/substack/node-browserify
[Jade's API]: http://jade-lang.com/api/

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