Meet npm Pro: unlimited public & private packages + package-based permissions.Learn more »

electron-transponder

0.1.4 • Public • Published

Electron Communicator

An electron router that has a similar interface/usage as an HTTP server, Express, and similar libraries.

Usage

In electron:

import { ipcMain } from 'electron';
import { mainTransponder } from 'electron-transponder';
 
// bootstrap transponder to start listening
const transponder = mainTransponder(ipcMain);
 
// register routes -- works similarly to app.get() or app.post()
transponder.register('GET', 'users', async (req, res) => {
  let users = await getUsers();
 
  res.send(users);
});

In front-end:

import { renderTransponder } from 'electron-transponder';
 
let users = await renderTansponder.request('GET' || requestMethods.GET, 'api/users', {
  organization_id: 3
});

Roadmap

Install

npm i electron-transponder

DownloadsWeekly Downloads

1

Version

0.1.4

License

MIT

Unpacked Size

46.4 kB

Total Files

24

Last publish

Collaborators

  • avatar