yaorg / node-measured

A Node metrics library for measuring and reporting application-level metrics, inspired by Coda Hale, Yammer Inc's Dropwizard Metrics Libraries
https://yaorg.github.io/node-measured/
MIT License
517 stars 52 forks source link

Object.values is not a function on Nodejs 6.9.0 #51

Closed muxator closed 5 years ago

muxator commented 6 years ago

According to its package.json, measured-core 1.11.2 should support Node >= 5.12.

When testing Etherpad 1.7 against Node 6.9.0 (https://github.com/ether/etherpad-lite/issues/3459), I found that measured-core uses Object.values(), a feature that was introduced in Node 7.x.

https://github.com/yaorg/node-measured/blob/4327cb82759058a6b3571a3b659e156672d96ffd/packages/measured-core/lib/validators/metricValidators.js#L3

For Etherpad we resolved using a polyfill (https://github.com/ether/etherpad-lite/commit/fc14f60a4b206b841766e302e65957610193ba61).

For next node-measured version, you may want to update package.json (requiring node >= 7.x). Or - if you want to continue supporting Node 5 - either use a polyfill or change the code to not use Object.values().

Thank you for your library!

fieldju commented 6 years ago

I would like this project compatible with all currently supported Node LTS releases. The oldest LTS release is 6.x and will be supported until April 2019.

So I think refactoring or poly-filling would be good.

Let me look into things, but the poly fills might be nice, since they can be dropped once 6.x becomes unsupported.