1.0.2 • Published 10 years ago

wellfirst v1.0.2

Weekly downloads
1
License
MIT
Repository
-
Last release
10 years ago

#wellfirst

Usage

wellFirst(asyncFunction, 'arguments', 'to', 'your', 'function')

.then will call its provided function with a single argument of an array-like object of the results of the would-be callback.

npm install wellfirst

var wellFirst = require('wellfirst');
var fs = require('fs');

console.log('EXECUTE PROMISE');
console.log(Date.now());
wellFirst(fs.stat, 'wellfirst.js')
.then(function(result){
  console.log(Date.now());
  console.log('END PROMISE');
})
.then(function(){
  console.log('EXECUTE PROMISE');
  console.log(Date.now());
  return wellFirst(fs.stat, 'wellfirst.js')
})
.then(function(result){
  console.log(Date.now());
  console.log('END PROMISE');
  console.log('EXECUTE CALLBACK');
  console.log(Date.now());
  fs.stat('wellfirst.js', function(err, result){
    console.log(Date.now());
    console.log('END CALLBACK');
  })
})
1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago