electron pug
This module is a simple file
protocol interceptor for electron which compiles all (local) URLs to files with .pug
extension (e.g /home/electron-pug/index.pug
) on the fly.
![license](https://img.shields.io/npm/l/electron-pug.svg)
Installation
npm install electron-pug
Usage
Just initialize this module with desired options for Pug package and your locals:
'use strict';
const {app, BrowserWindow} = require('electron');
const locals = {};
const pug = require('electron-pug')({pretty: true}, locals);
app.on('ready', () => {
let mainWindow = new BrowserWindow({ width: 800, height: 600 });
mainWindow.loadUrl(`file://${__dirname}/index.pug`);
});
Even more!
If you want to have least effort when developing electron packages, take a look at neutron!