@jabuco/epm
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

electron-package-manager

Dynamically install and require modules in electron

Usage

import epm from 'electron-package-manager';

const CWD = '/tmp/test-plugins';
const PACKAGE = 'levelup';

epm
  .pack(PACKAGE, CWD)
  .then(packagename => epm.extract(PACKAGE, CWD, path.join(CWD, packagename)))
  .then(modulepath => {
    console.log('requiring', modulepath);
    const mylib = require(modulepath);
    console.log('required', mylib);
  });

Readme

Keywords

none

Package Sidebar

Install

npm i @jabuco/epm

Weekly Downloads

1

Version

1.2.1

License

MIT

Unpacked Size

14.3 kB

Total Files

7

Last publish

Collaborators

  • peanutbother