Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
Column
width25%

Parameters


  • Asynchronous Functionasynchronous function
  • this argument (optional)
    (info) Typically, the parent object of the function is passed; this is required if internally the function uses the this keyword.
Column
width25%

Alternative Parameters


  • Object object containing asynchronous functions
Column
width25%

Return Value


A top-down function is returned.

Column
width25%

Exception Handling


If the callback receives an error object, this an error is thrown.

Examples

Code Block
titleWrap fs.readFile in a fiber
const fs = require('fs');
var readFile = pjs.fiber.wrap(fs.readFile);
var text = readFile("somefile.txt", 'utf8');

...