diff --git a/doc/api/util.md b/doc/api/util.md index 2653c01af1d4c9..9cca721e63cc94 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -525,6 +525,16 @@ console.log(promisified === doSomething[util.promisify.custom]); This can be useful for cases where the original function does not follow the standard format of taking an error-first callback as the last argument. +For example, with a function that takes in `(foo, onSuccessCallback, onErrorCallback)`: + +```js +doSomething[util.promisify.custom] = function(foo) { + return new Promise(function(resolve, reject) { + doSomething(foo, resolve, reject); + }); +}; +``` + ### util.promisify.custom