pr-wrap
Wraps callback-based methods in promises and uses ES6 Proxy for wrapping entire modules.
Install
npm install pr-wrap --save
Syntax
Wraps single function:
func context
-
func
<function>
target function -
context
<object>
context for function
Creates proxy-object for wrapping all method calls:
allsrcObj
srcObj
<object>
source object
Usage
Wrapping single function:
const prWrap = '/some/dir'
Wrapping whole module:
const fsPr = allfsPr