Browse Source

Add dogapi.now helper method

pull/14/head
Brett Langdon 11 years ago
parent
commit
43834e9fec
1 changed files with 15 additions and 0 deletions
  1. +15
    -0
      lib/index.js

+ 15
- 0
lib/index.js View File

@ -31,8 +31,23 @@ function initialize(options){
}
};
/*section: dogapi
*comment: get the current POSIX timestamp
*example: |
* ```javascript
* var dogapi = require("dogapi");
* dogapi.now();
* // this is the same as
* parseInt(new Date().getTime() / 1000);
* ```
*/
function now(){
return parseInt(new Date().getTime() / 1000);
};
module.exports.client = require("./client"),
module.exports.initialize = initialize;
module.exports.now = now;
module.exports.OK = 0;
module.exports.WARNING = 1;
module.exports.CRITICAL = 2;


Loading…
Cancel
Save