promwrap
Wraps modules, and other objects, full of callback functions in promises.
let let _module = fun prop: 'test'
API
promwrap(value<T>, {exclude: string[]|string, excludeMain: bool, own: bool}): T
Promisify all function properties of value
. If value
is a Function
,
it will be promisified instead. Members of Object.prototype
are not
promisified.
Returns value
, wrapped by a Proxy
.
- If
exclude
is supplied, do not promisify this prop/list of props. - If
excludeMain
is truthy andvalue
is aFunction
, treatvalue
like a plainObject
and promisify its props instead ofvalue
itself. In addition, members ofFunction.prototype
will not be promisified. - If
own
is truthy, only promisify theObject
's "own" (in theObject.hasOwnProperty()
sense) props