firu
TypeScript icon, indicating that this package has built-in type declarations

0.4.0 • Public • Published

firu - simple framework for Electron and React

firu is a simple library which allows you to:

  • create Electron's BrowserWindow with only script file instead of html file.
  • simply sending data from main process to renderer process.
  • calling functions in main process from renderer process.
  • functions that simplify using firu with React

Sample use

Creating window

import { FiruWindow } from "firu/native";

const path = "./path/to/script"; 
const options = {};
const win = new FiruWindow(path, options);

Creating window with data

import { FiruWindow } from "firu/native";

const path = "./path/to/script"; 
const options = {
    data: {
        msg: "Lorem ipsum",
        foo: () => console.log("foo")
    }
};
const win = new FiruWindow(path, options);

Using data and function in renderer process

import { firu } from "firu/dom";

firu.whenReady().then(() => {
    console.log("msg:", firu.data["msg"]);
    firu.data["foo"]();
});

Simple rendering of React content

import { firu } from "firu/dom";

firu.render(<Bar></Bar>);

Readme

Keywords

none

Package Sidebar

Install

npm i firu

Weekly Downloads

2

Version

0.4.0

License

ISC

Unpacked Size

55.9 kB

Total Files

49

Last publish

Collaborators

  • stapislaw