0.1.1 • Published 7 years ago

syncblock v0.1.1

Weekly downloads
2
License
MIT
Repository
-
Last release
7 years ago

syncblock

Turns Asynchronous block into synchronous one

Usage

Install

$ npm install --save syncblock

Example

var fs = require('fs');
var syncblock = require('syncblock');

syncblock.begin(function(ticket) {
  // request HTTP, read/write DB,...
  fs.readFile('/etc/passwd', function(err, data) {
    if (err) throw err;
    console.log(data);
    ticket.end();
  });
});