1.0.0 • Published 7 years ago

electron-pug-less v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

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

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);

// Standard stuff

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

  mainWindow.loadUrl(`file://${__dirname}/index.pug`);
  // the rest...
});

Even more!

If you want to have least effort when developing electron packages, take a look at neutron!