Socket
Socket
Sign inDemoInstall

dogapi

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dogapi - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

test/api/metric.js

16

lib/api/metric.js

@@ -41,2 +41,18 @@ var client = require("../client");

}
// Try to normalize `points`
// DEV: We need `points` to be an array of arrays regardless of what they give us
// Always wrap points in an array, this way we will get:
// 500 => [500]
// [<timestamp>, 500] => [[<timestamp>, 500]]
points = [points];
points = points.map(function(point){
// Make sure each point is an array, if not make array with current timestamp
// 500 => [<timestamp>, 500]
// [<timestamp>, 500] => unchanged
if(!Array.isArray(point)){
var now = parseInt(new Date().getTime() / 1000);
point = [now, point];
}
return point;
});

@@ -43,0 +59,0 @@ extra = extra || {};

7

package.json
{
"name": "dogapi",
"version": "1.0.5",
"version": "1.0.6",
"description": "Datadog API Node.JS Client",
"main": "lib/index.js",
"scripts": {
"test": "./node_modules/.bin/mocha ./test",
"test": "./node_modules/.bin/mocha --recursive ./test",
"docs": "node ./docs/create.js > index.html"

@@ -46,4 +46,5 @@ },

"marked": "^0.3.3",
"mocha": "^2.2.5"
"mocha": "^2.2.5",
"sinon": "^1.15.4"
}
}

@@ -13,2 +13,9 @@ node-dogapi

## StatsD
`dogapi` does not provide any functionality to talk to a local `dogstatsd` server.
This library is purely an interface to the HTTP api.
If you are looking for a good Datadog StatsD library, I recommend checking out [node-dogstatsd](https://github.com/joybro/node-dogstatsd).
## Installation

@@ -15,0 +22,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc