# electron-twig

> Electron module to render Twig templates

Latest version **1.1.1** (published 2017-08-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install electron-twig
pnpm add electron-twig
yarn add electron-twig
bun add electron-twig
```

## 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 | 1.1.1 |
| Published | 2017-08-14 |
| First published | 2017-08-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Théo Attali |
| Maintainers | tattali |
| Keywords | electron, twig |

## Links

- npm: https://www.npmjs.com/package/electron-twig
- Repository: https://github.com/tattali/electron-twig
- Issues: https://github.com/tattali/electron-twig/issues
- npm.io page: https://npm.io/package/electron-twig

## Dependencies (2)

- [mime](https://npm.io/package/mime.md) ^1.3.6
- [twig](https://npm.io/package/twig.md) ^1.10.5

## Recent versions

- 1.1.1 (latest) — 2017-08-14
- 1.1.0 — 2017-08-14
- 1.0.8 — 2017-08-13
- 1.0.7 — 2017-08-12
- 1.0.6 — 2017-08-12
- 1.0.5 — 2017-08-11
- 1.0.4 — 2017-08-11
- 1.0.3 — 2017-08-11
- 1.0.2 — 2017-08-11
- 1.0.1 — 2017-08-11
- 1.0.0 — 2017-08-11

## README

# Electron Twig
[![npm](https://img.shields.io/npm/v/electron-twig.svg)](https://www.npmjs.com/package/electron-twig)
[![npm](https://img.shields.io/npm/dt/electron-twig.svg)](https://www.npmjs.com/package/electron-twig)
[![David](https://img.shields.io/david/tattali/electron-twig.svg)](https://www.npmjs.com/package/electron-twig)

Get [Twig.js](https://github.com/twigjs/twig.js) the JS implementation of the Twig Templating Language on [electron](https://github.com/atom/electron) projects.

This package is a simple `file protocol interceptor` which compiles files with `.twig` extension.

## Installation

```
npm install electron-twig
```

## Usage

```js
const {app, BrowserWindow} = require('electron')
const twig                 = require('electron-twig')

app.on('ready', () => {
  let win = new BrowserWindow({width: 800, height: 600})

  win.loadURL(`file://${__dirname}/views/index.html.twig`)

  // etc.
})
```

Put variables in template

```js
const {app, BrowserWindow} = require('electron')
const twig                 = require('electron-twig')

app.on('ready', () => {
  let win = new BrowserWindow({width: 800, height: 600})

  win.loadURL(`file://${__dirname}/views/index.html.twig`)
  twig.view = {
    foo: 'bar'
  }

  // etc.
})
```

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