New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

electronade

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electronade

electronade is a framework helper for the electron projects.

latest
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

electronade

It's a framework helper for the electron projects.

npm NPM npms.io (quality) Libraries.io dependency status for latest release Maintenance

Installation

npm install electronade

Usage

See electronade.netlify.app for details.

setting handles from electronade packages

main.ts

import { app } from "electron";
import { setHandles } from "electronade";
import { handles as someHandles } from "electronade-some";
import { handles as otherHandles } from "electronade-other";

app.whenReady().then(() => {
  setHandles({
    someHandles,
    otherHandles
  });
});

exposing from electronade packages

get ready for generation of preload file, base file should exist preload_base.ts

import {
  contextBridge,
  ipcRenderer,
  IpcRendererEvent
} from "electron";

contextBridge.exposeInMainWorld("ownAPI", {
  mine: {
    work: (message: string) =>
      ipcRenderer.invoke("mine:work", message)
  }
});

initialize config file for preload preparation. electronade.config.js will be generated.

npx electronade --init

edit electronade.config.js

const { preloadObject: somePreload } = require("electronade-some");
const { preloadObject: otherPreload } = require("electronade-other");

module.exports = {
  input: {
    baseFile: "path/to/preload_base.ts",
    exposingName: "electronade",
    preloadObjects: {
      somePreload,
      otherPreload
    }
  },
  output: {
    file: "path/to/preload.ts"
  }
};

prepare merged preload file.

npx electronade --prepare-preload --config electronade.config.js

calling from renderer

const result1 = await electronade.some.work(params);
const result2 = await electronade.other.anotherWork();
const result3 = await ownAPI.mine.work("message");

Keywords

electron

FAQs

Package last updated on 04 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts