1.1.1 • Published 7 years ago

electron-twig v1.1.1

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

7 years ago

1.1.0

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago