1.1.1 • Published 8 years ago

electron-twig v1.1.1

Weekly downloads
13
License
MIT
Repository
github
Last release
8 years ago

Electron Twig

npm npm David

Get Twig.js the JS implementation of the Twig Templating Language on electron projects.

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

Installation

npm install electron-twig

Usage

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

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.
})
1.1.1

8 years ago

1.1.0

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago