trouble-in-terror-town/node_modules/another-npm-registry-client/lib/send-anonymous-CLI-metrics.js
Mikolaj 2bbacbea09 did some more work on networking and removed EOS in favor of LRM
did some more work on networking and removed EOS in favor of Light Reflective Mirror
2022-05-31 15:04:31 +02:00

19 lines
533 B
JavaScript

module.exports = send
var assert = require('assert')
var url = require('url')
function send (registryUrl, params, cb) {
assert(typeof registryUrl === 'string', 'must pass registry URI')
assert(params && typeof params === 'object', 'must pass params')
assert(typeof cb === 'function', 'must pass callback')
var uri = url.resolve(registryUrl, '-/npm/anon-metrics/v1/' +
encodeURIComponent(params.metricId))
this.request(uri, {
method: 'PUT',
body: JSON.stringify(params.metrics),
authed: false
}, cb)
}