femur
femur is used to wrap a function so as to provide an execution timer. When wrapping a function with femur, you provide a callback to which femur will pass the function execution duration. As such, make sure your duration callback is asynchronous.
Install
$ npm install femur --save
Usage
Wrapping functions
The main point of femur is to be able to provide an execution duration logger when initially wrapping a function. As such, using femur is pretty simple.
const femur = ; { console;} { return Math;} // Wrapping synchronous functions is simple.let wrappedMax = femur;; // returns 5 and logs the duration to the console // Wrapping asynchronous functions is just as easy. { ;} let asyncWrappedMax = femur;// As a note on ordering, the below will log the duration to the console first,// and then it will log 5 to the console.;
Release History
*1.0.0 Initial release.