Skip to content

Commit 45d104a

Browse files
author
Joël Charles
committed
README
1 parent 49f1f5f commit 45d104a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
11
# electron-package-manager
22
Dynamically install and require modules in electron
3+
4+
## Usage
5+
```javascript
6+
import epm from 'electron-package-manager';
7+
8+
const CWD = '/tmp/test-plugins';
9+
const PACKAGE = 'levelup';
10+
11+
epm
12+
.pack(PACKAGE, CWD)
13+
.then(packagename => epm.extract(PACKAGE, CWD, path.join(CWD, packagename)))
14+
.then(modulepath => {
15+
console.log('requiring', modulepath);
16+
const mylib = require(modulepath);
17+
console.log('required', mylib);
18+
});
19+
```

0 commit comments

Comments
 (0)