1.1.1 • Published 9 years ago

electron-twig v1.1.1

Weekly downloads
13
License
MIT
Repository
github
Last release
9 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

9 years ago

1.1.0

9 years ago

1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago