Skip to content

NPM package For Pass View Electron Web Page Easier and Faster Like Laravel Framework.

Notifications You must be signed in to change notification settings

rezaghz/electron-view

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Electron View

NPM package For Pass View Electron Web Page Easier and Faster Like Laravel Framework.

Installation

install by NPM

$ npm install electron-view --save

install by Yarn

$ yarn add electron-view

How To Use ?

Example For Es6

/**
* View Function Information Parameters
* @param {string} address - The address of Web page 
* @param {string} {folderName = views} - The Name of Folder For View Folder Default = 
* @param {string} {ext = .html } - The extension of Web page
*/
import view from 'electron-view';
import {BrowserWindow} from 'electron';
let mainWin = new BrowserWindow({});
mainWin.loadURL(view("panel.dashboard.index"));

Example For Es5 or below

/**
* View Function Information Parameters
* @param {string} address - The address of Web page 
* @param {string} {folderName = views} - The Name of Folder For View Folder Default = 
* @param {string} {ext = .html } - The extension of Web page
*/
const view = require('electron-view');
const {BrowserWindow} = require('electron');
let mainWin = new BrowserWindow({});
mainWin.loadURL(view("panel.dashboard.index"));

Output String

view("admin.dashboard.index");
// file://E://myProject/views/admin/dashboard/index.html
view("admin.dashboard.index","resources");
// file://E://myProject/resources/admin/dashboard/index.html
view("admin.dashboard.index","resources");
// file://E://myProject/resources/admin/dashboard/index.html
view("admin.dashboard.index","resources",".xml");
// file://E://myProject/resources/admin/dashboard/index.xml

About

NPM package For Pass View Electron Web Page Easier and Faster Like Laravel Framework.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published