tastypie
Version:
Tastypie is a webservice API framework for Node.js based on Django's Tastypie Framework. It provides a convenient, yet powerful and highly customizable, abstraction for creating REST-style interfaces
19 lines (12 loc) • 349 B
JavaScript
/**
* Get current time in miliseconds
*/
function now(){
// yes, we defer the work to another function to allow mocking it
// during the tests
return now.get();
}
now.get = (typeof Date.now === 'function')? Date.now : function(){
return +(new Date());
};
module.exports = now;