@@ -18,12 +18,10 @@ added: REPLACEME
1818* ` original ` {Function} An ` async ` function
1919* Returns: {Function} a callback style function
2020
21- This method converts Promise returning API endpoints to ones that use callbacks.
22- ` callbackify ` takes an ` async ` function (or a function that returns a Promise)
23- and returns a function following the common Node.js callback style, i.e. taking
24- a ` (err, val) => ... ` callback as the last argument. In the callback, the first
25- argument will be the rejection reason (or ` null ` if the Promise resolved), and
26- the second argument will be the resolved value.
21+ Takes an ` async ` function (or a function that returns a Promise) and returns a
22+ function following the Node.js error first callback style. In the callback, the
23+ first argument will be the rejection reason (or ` null ` if the Promise resolved),
24+ and the second argument will be the resolved value.
2725
2826For example:
2927
@@ -41,18 +39,17 @@ callbackFunction((err, ret) => {
4139});
4240```
4341
44- Will print something like :
42+ Will print:
4543
4644``` txt
4745hello world
4846```
4947
5048* Note* :
5149
52- * Like with most callback style functions, the callback is executed in an
53- async context (i.e. having a limited stacktrace). If the callback throws, the
54- process will emit an [ ` 'uncaughtException' ` ] [ ] event, and if not handled will
55- exit.
50+ * The callback is executed asynchronously, and will have a limited stack trace.
51+ If the callback throws, the process will emit an [ ` 'uncaughtException' ` ] [ ]
52+ event, and if not handled will exit.
5653
5754* Since ` null ` has a special meaning as the first argument to a callback, if a
5855wrapped function rejects a ` Promise ` with a falsy value as a reason, the value
0 commit comments