Preparing search index...
The search index is not available bun-types
promisify< TCustom > ( fn: "util" . CustomPromisify < TCustom > ) : TCustom
Returns TCustom
promisify< TResult > ( fn: ( ( callback: ( ( err: any , result: TResult ) => void ) ) => void ) ) : ( ( ) => Promise < TResult > )
Parameters
fn: ( ( callback: ( ( err: any , result: TResult ) => void ) ) => void )
( callback: ( ( err: any , result: TResult ) => void ) ) : void
Parameters
callback: ( ( err: any , result: TResult ) => void )
( err: any , result: TResult ) : void
Returns void
Returns void
Returns ( ( ) => Promise < TResult > )
( ) : Promise < TResult >
Returns Promise < TResult >
promisify( fn: ( ( callback: ( ( err?: any ) => void ) ) => void ) ) : ( ( ) => Promise < void > )
Parameters
fn: ( ( callback: ( ( err?: any ) => void ) ) => void )
( callback: ( ( err?: any ) => void ) ) : void
Parameters
callback: ( ( err?: any ) => void )
( err?: any ) : void
Returns void
Returns void
Returns ( ( ) => Promise < void > )
( ) : Promise < void >
Returns Promise < void >
promisify< T1 , TResult > ( fn: ( ( arg1: T1 , callback: ( ( err: any , result: TResult ) => void ) ) => void ) ) : ( ( arg1: T1 ) => Promise < TResult > )
Parameters
fn: ( ( arg1: T1 , callback: ( ( err: any , result: TResult ) => void ) ) => void )
( arg1: T1 , callback: ( ( err: any , result: TResult ) => void ) ) : void
Parameters
arg1: T1
callback: ( ( err: any , result: TResult ) => void )
( err: any , result: TResult ) : void
Returns void
Returns void
Returns ( ( arg1: T1 ) => Promise < TResult > )
( arg1: T1 ) : Promise < TResult >
Returns Promise < TResult >
promisify< T1 > ( fn: ( ( arg1: T1 , callback: ( ( err?: any ) => void ) ) => void ) ) : ( ( arg1: T1 ) => Promise < void > )
Parameters
fn: ( ( arg1: T1 , callback: ( ( err?: any ) => void ) ) => void )
( arg1: T1 , callback: ( ( err?: any ) => void ) ) : void
Parameters
arg1: T1
callback: ( ( err?: any ) => void )
( err?: any ) : void
Returns void
Returns void
Returns ( ( arg1: T1 ) => Promise < void > )
( arg1: T1 ) : Promise < void >
Returns Promise < void >
promisify< T1 , T2 , TResult > ( fn: ( ( arg1: T1 , arg2: T2 , callback: ( ( err: any , result: TResult ) => void ) ) => void ) ) : ( ( arg1: T1 , arg2: T2 ) => Promise < TResult > )
Parameters
fn: ( ( arg1: T1 , arg2: T2 , callback: ( ( err: any , result: TResult ) => void ) ) => void )
( arg1: T1 , arg2: T2 , callback: ( ( err: any , result: TResult ) => void ) ) : void
Parameters
arg1: T1
arg2: T2
callback: ( ( err: any , result: TResult ) => void )
( err: any , result: TResult ) : void
Returns void
Returns void
Returns ( ( arg1: T1 , arg2: T2 ) => Promise < TResult > )
( arg1: T1 , arg2: T2 ) : Promise < TResult >
Returns Promise < TResult >
promisify< T1 , T2 > ( fn: ( ( arg1: T1 , arg2: T2 , callback: ( ( err?: any ) => void ) ) => void ) ) : ( ( arg1: T1 , arg2: T2 ) => Promise < void > )
Parameters
fn: ( ( arg1: T1 , arg2: T2 , callback: ( ( err?: any ) => void ) ) => void )
( arg1: T1 , arg2: T2 , callback: ( ( err?: any ) => void ) ) : void
Parameters
arg1: T1
arg2: T2
callback: ( ( err?: any ) => void )
( err?: any ) : void
Returns void
Returns void
Returns ( ( arg1: T1 , arg2: T2 ) => Promise < void > )
( arg1: T1 , arg2: T2 ) : Promise < void >
Returns Promise < void >
promisify< T1 , T2 , T3 , TResult > ( fn: ( ( arg1: T1 , arg2: T2 , arg3: T3 , callback: ( ( err: any , result: TResult ) => void ) ) => void ) ) : ( ( arg1: T1 , arg2: T2 , arg3: T3 ) => Promise < TResult > )
Parameters
fn: ( ( arg1: T1 , arg2: T2 , arg3: T3 , callback: ( ( err: any , result: TResult ) => void ) ) => void )
( arg1: T1 , arg2: T2 , arg3: T3 , callback: ( ( err: any , result: TResult ) => void ) ) : void
Parameters
arg1: T1
arg2: T2
arg3: T3
callback: ( ( err: any , result: TResult ) => void )
( err: any , result: TResult ) : void
Returns void
Returns void
Returns ( ( arg1: T1 , arg2: T2 , arg3: T3 ) => Promise < TResult > )
( arg1: T1 , arg2: T2 , arg3: T3 ) : Promise < TResult >
Parameters
arg1: T1
arg2: T2
arg3: T3
Returns Promise < TResult >
promisify< T1 , T2 , T3 > ( fn: ( ( arg1: T1 , arg2: T2 , arg3: T3 , callback: ( ( err?: any ) => void ) ) => void ) ) : ( ( arg1: T1 , arg2: T2 , arg3: T3 ) => Promise < void > )
Parameters
fn: ( ( arg1: T1 , arg2: T2 , arg3: T3 , callback: ( ( err?: any ) => void ) ) => void )
( arg1: T1 , arg2: T2 , arg3: T3 , callback: ( ( err?: any ) => void ) ) : void
Parameters
arg1: T1
arg2: T2
arg3: T3
callback: ( ( err?: any ) => void )
( err?: any ) : void
Returns void
Returns void
Returns ( ( arg1: T1 , arg2: T2 , arg3: T3 ) => Promise < void > )
( arg1: T1 , arg2: T2 , arg3: T3 ) : Promise < void >
Parameters
arg1: T1
arg2: T2
arg3: T3
Returns Promise < void >
promisify< T1 , T2 , T3 , T4 , TResult > ( fn: ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , callback: ( ( err: any , result: TResult ) => void ) ) => void ) ) : ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 ) => Promise < TResult > )
Parameters
fn: ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , callback: ( ( err: any , result: TResult ) => void ) ) => void )
( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , callback: ( ( err: any , result: TResult ) => void ) ) : void
Parameters
arg1: T1
arg2: T2
arg3: T3
arg4: T4
callback: ( ( err: any , result: TResult ) => void )
( err: any , result: TResult ) : void
Returns void
Returns void
Returns ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 ) => Promise < TResult > )
( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 ) : Promise < TResult >
Parameters
arg1: T1
arg2: T2
arg3: T3
arg4: T4
Returns Promise < TResult >
promisify< T1 , T2 , T3 , T4 > ( fn: ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , callback: ( ( err?: any ) => void ) ) => void ) ) : ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 ) => Promise < void > )
Parameters
fn: ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , callback: ( ( err?: any ) => void ) ) => void )
( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , callback: ( ( err?: any ) => void ) ) : void
Parameters
arg1: T1
arg2: T2
arg3: T3
arg4: T4
callback: ( ( err?: any ) => void )
( err?: any ) : void
Returns void
Returns void
Returns ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 ) => Promise < void > )
( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 ) : Promise < void >
Parameters
arg1: T1
arg2: T2
arg3: T3
arg4: T4
Returns Promise < void >
promisify< T1 , T2 , T3 , T4 , T5 , TResult > ( fn: ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , arg5: T5 , callback: ( ( err: any , result: TResult ) => void ) ) => void ) ) : ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , arg5: T5 ) => Promise < TResult > )
Parameters
fn: ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , arg5: T5 , callback: ( ( err: any , result: TResult ) => void ) ) => void )
( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , arg5: T5 , callback: ( ( err: any , result: TResult ) => void ) ) : void
Parameters
arg1: T1
arg2: T2
arg3: T3
arg4: T4
arg5: T5
callback: ( ( err: any , result: TResult ) => void )
( err: any , result: TResult ) : void
Returns void
Returns void
Returns ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , arg5: T5 ) => Promise < TResult > )
( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , arg5: T5 ) : Promise < TResult >
Parameters
arg1: T1
arg2: T2
arg3: T3
arg4: T4
arg5: T5
Returns Promise < TResult >
promisify< T1 , T2 , T3 , T4 , T5 > ( fn: ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , arg5: T5 , callback: ( ( err?: any ) => void ) ) => void ) ) : ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , arg5: T5 ) => Promise < void > )
Parameters
fn: ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , arg5: T5 , callback: ( ( err?: any ) => void ) ) => void )
( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , arg5: T5 , callback: ( ( err?: any ) => void ) ) : void
Parameters
arg1: T1
arg2: T2
arg3: T3
arg4: T4
arg5: T5
callback: ( ( err?: any ) => void )
( err?: any ) : void
Returns void
Returns void
Returns ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , arg5: T5 ) => Promise < void > )
( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , arg5: T5 ) : Promise < void >
Parameters
arg1: T1
arg2: T2
arg3: T3
arg4: T4
arg5: T5
Returns Promise < void >
promisify( fn: Function ) : Function
Returns Function
promisify< TCustom > ( fn: "util" . CustomPromisify < TCustom > ) : TCustom
Returns TCustom
promisify< TResult > ( fn: ( ( callback: ( ( err: any , result: TResult ) => void ) ) => void ) ) : ( ( ) => Promise < TResult > )
Parameters
fn: ( ( callback: ( ( err: any , result: TResult ) => void ) ) => void )
( callback: ( ( err: any , result: TResult ) => void ) ) : void
Parameters
callback: ( ( err: any , result: TResult ) => void )
( err: any , result: TResult ) : void
Returns void
Returns void
Returns ( ( ) => Promise < TResult > )
( ) : Promise < TResult >
Returns Promise < TResult >
promisify( fn: ( ( callback: ( ( err?: any ) => void ) ) => void ) ) : ( ( ) => Promise < void > )
Parameters
fn: ( ( callback: ( ( err?: any ) => void ) ) => void )
( callback: ( ( err?: any ) => void ) ) : void
Parameters
callback: ( ( err?: any ) => void )
( err?: any ) : void
Returns void
Returns void
Returns ( ( ) => Promise < void > )
( ) : Promise < void >
Returns Promise < void >
promisify< T1 , TResult > ( fn: ( ( arg1: T1 , callback: ( ( err: any , result: TResult ) => void ) ) => void ) ) : ( ( arg1: T1 ) => Promise < TResult > )
Parameters
fn: ( ( arg1: T1 , callback: ( ( err: any , result: TResult ) => void ) ) => void )
( arg1: T1 , callback: ( ( err: any , result: TResult ) => void ) ) : void
Parameters
arg1: T1
callback: ( ( err: any , result: TResult ) => void )
( err: any , result: TResult ) : void
Returns void
Returns void
Returns ( ( arg1: T1 ) => Promise < TResult > )
( arg1: T1 ) : Promise < TResult >
Returns Promise < TResult >
promisify< T1 > ( fn: ( ( arg1: T1 , callback: ( ( err?: any ) => void ) ) => void ) ) : ( ( arg1: T1 ) => Promise < void > )
Parameters
fn: ( ( arg1: T1 , callback: ( ( err?: any ) => void ) ) => void )
( arg1: T1 , callback: ( ( err?: any ) => void ) ) : void
Parameters
arg1: T1
callback: ( ( err?: any ) => void )
( err?: any ) : void
Returns void
Returns void
Returns ( ( arg1: T1 ) => Promise < void > )
( arg1: T1 ) : Promise < void >
Returns Promise < void >
promisify< T1 , T2 , TResult > ( fn: ( ( arg1: T1 , arg2: T2 , callback: ( ( err: any , result: TResult ) => void ) ) => void ) ) : ( ( arg1: T1 , arg2: T2 ) => Promise < TResult > )
Parameters
fn: ( ( arg1: T1 , arg2: T2 , callback: ( ( err: any , result: TResult ) => void ) ) => void )
( arg1: T1 , arg2: T2 , callback: ( ( err: any , result: TResult ) => void ) ) : void
Parameters
arg1: T1
arg2: T2
callback: ( ( err: any , result: TResult ) => void )
( err: any , result: TResult ) : void
Returns void
Returns void
Returns ( ( arg1: T1 , arg2: T2 ) => Promise < TResult > )
( arg1: T1 , arg2: T2 ) : Promise < TResult >
Returns Promise < TResult >
promisify< T1 , T2 > ( fn: ( ( arg1: T1 , arg2: T2 , callback: ( ( err?: any ) => void ) ) => void ) ) : ( ( arg1: T1 , arg2: T2 ) => Promise < void > )
Parameters
fn: ( ( arg1: T1 , arg2: T2 , callback: ( ( err?: any ) => void ) ) => void )
( arg1: T1 , arg2: T2 , callback: ( ( err?: any ) => void ) ) : void
Parameters
arg1: T1
arg2: T2
callback: ( ( err?: any ) => void )
( err?: any ) : void
Returns void
Returns void
Returns ( ( arg1: T1 , arg2: T2 ) => Promise < void > )
( arg1: T1 , arg2: T2 ) : Promise < void >
Returns Promise < void >
promisify< T1 , T2 , T3 , TResult > ( fn: ( ( arg1: T1 , arg2: T2 , arg3: T3 , callback: ( ( err: any , result: TResult ) => void ) ) => void ) ) : ( ( arg1: T1 , arg2: T2 , arg3: T3 ) => Promise < TResult > )
Parameters
fn: ( ( arg1: T1 , arg2: T2 , arg3: T3 , callback: ( ( err: any , result: TResult ) => void ) ) => void )
( arg1: T1 , arg2: T2 , arg3: T3 , callback: ( ( err: any , result: TResult ) => void ) ) : void
Parameters
arg1: T1
arg2: T2
arg3: T3
callback: ( ( err: any , result: TResult ) => void )
( err: any , result: TResult ) : void
Returns void
Returns void
Returns ( ( arg1: T1 , arg2: T2 , arg3: T3 ) => Promise < TResult > )
( arg1: T1 , arg2: T2 , arg3: T3 ) : Promise < TResult >
Parameters
arg1: T1
arg2: T2
arg3: T3
Returns Promise < TResult >
promisify< T1 , T2 , T3 > ( fn: ( ( arg1: T1 , arg2: T2 , arg3: T3 , callback: ( ( err?: any ) => void ) ) => void ) ) : ( ( arg1: T1 , arg2: T2 , arg3: T3 ) => Promise < void > )
Parameters
fn: ( ( arg1: T1 , arg2: T2 , arg3: T3 , callback: ( ( err?: any ) => void ) ) => void )
( arg1: T1 , arg2: T2 , arg3: T3 , callback: ( ( err?: any ) => void ) ) : void
Parameters
arg1: T1
arg2: T2
arg3: T3
callback: ( ( err?: any ) => void )
( err?: any ) : void
Returns void
Returns void
Returns ( ( arg1: T1 , arg2: T2 , arg3: T3 ) => Promise < void > )
( arg1: T1 , arg2: T2 , arg3: T3 ) : Promise < void >
Parameters
arg1: T1
arg2: T2
arg3: T3
Returns Promise < void >
promisify< T1 , T2 , T3 , T4 , TResult > ( fn: ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , callback: ( ( err: any , result: TResult ) => void ) ) => void ) ) : ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 ) => Promise < TResult > )
Parameters
fn: ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , callback: ( ( err: any , result: TResult ) => void ) ) => void )
( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , callback: ( ( err: any , result: TResult ) => void ) ) : void
Parameters
arg1: T1
arg2: T2
arg3: T3
arg4: T4
callback: ( ( err: any , result: TResult ) => void )
( err: any , result: TResult ) : void
Returns void
Returns void
Returns ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 ) => Promise < TResult > )
( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 ) : Promise < TResult >
Parameters
arg1: T1
arg2: T2
arg3: T3
arg4: T4
Returns Promise < TResult >
promisify< T1 , T2 , T3 , T4 > ( fn: ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , callback: ( ( err?: any ) => void ) ) => void ) ) : ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 ) => Promise < void > )
Parameters
fn: ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , callback: ( ( err?: any ) => void ) ) => void )
( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , callback: ( ( err?: any ) => void ) ) : void
Parameters
arg1: T1
arg2: T2
arg3: T3
arg4: T4
callback: ( ( err?: any ) => void )
( err?: any ) : void
Returns void
Returns void
Returns ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 ) => Promise < void > )
( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 ) : Promise < void >
Parameters
arg1: T1
arg2: T2
arg3: T3
arg4: T4
Returns Promise < void >
promisify< T1 , T2 , T3 , T4 , T5 , TResult > ( fn: ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , arg5: T5 , callback: ( ( err: any , result: TResult ) => void ) ) => void ) ) : ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , arg5: T5 ) => Promise < TResult > )
Parameters
fn: ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , arg5: T5 , callback: ( ( err: any , result: TResult ) => void ) ) => void )
( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , arg5: T5 , callback: ( ( err: any , result: TResult ) => void ) ) : void
Parameters
arg1: T1
arg2: T2
arg3: T3
arg4: T4
arg5: T5
callback: ( ( err: any , result: TResult ) => void )
( err: any , result: TResult ) : void
Returns void
Returns void
Returns ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , arg5: T5 ) => Promise < TResult > )
( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , arg5: T5 ) : Promise < TResult >
Parameters
arg1: T1
arg2: T2
arg3: T3
arg4: T4
arg5: T5
Returns Promise < TResult >
promisify< T1 , T2 , T3 , T4 , T5 > ( fn: ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , arg5: T5 , callback: ( ( err?: any ) => void ) ) => void ) ) : ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , arg5: T5 ) => Promise < void > )
Parameters
fn: ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , arg5: T5 , callback: ( ( err?: any ) => void ) ) => void )
( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , arg5: T5 , callback: ( ( err?: any ) => void ) ) : void
Parameters
arg1: T1
arg2: T2
arg3: T3
arg4: T4
arg5: T5
callback: ( ( err?: any ) => void )
( err?: any ) : void
Returns void
Returns void
Returns ( ( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , arg5: T5 ) => Promise < void > )
( arg1: T1 , arg2: T2 , arg3: T3 , arg4: T4 , arg5: T5 ) : Promise < void >
Parameters
arg1: T1
arg2: T2
arg3: T3
arg4: T4
arg5: T5
Returns Promise < void >
promisify( fn: Function ) : Function
Returns Function
Takes a function following the common error-first callback style, i.e. taking an
(err, value) => ...
callback as the last argument, and returns a version that returns promises.Or, equivalently using
async function
s:If there is an
original[util.promisify.custom]
property present,promisify
will return its value, seeCustom promisified functions
.promisify()
assumes thatoriginal
is a function taking a callback as its final argument in all cases. Iforiginal
is not a function,promisify()
will throw an error. Iforiginal
is a function but its last argument is not an error-first callback, it will still be passed an error-first callback as its last argument.Using
promisify()
on class methods or other methods that usethis
may not work as expected unless handled specially: