{"id":18143313,"url":"https://github.com/tristanls/telemetry-events","last_synced_at":"2026-05-04T05:38:53.366Z","repository":{"id":23451135,"uuid":"26814907","full_name":"tristanls/telemetry-events","owner":"tristanls","description":"Helper for creating and emitting telemetry events.","archived":false,"fork":false,"pushed_at":"2019-08-08T14:04:17.000Z","size":32,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-20T22:46:39.548Z","etag":null,"topics":["javascript","logging","metrics","nodejs","telemetry","usage"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tristanls.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-18T15:14:45.000Z","updated_at":"2025-08-27T12:06:35.000Z","dependencies_parsed_at":"2022-08-30T17:40:52.739Z","dependency_job_id":null,"html_url":"https://github.com/tristanls/telemetry-events","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/tristanls/telemetry-events","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tristanls%2Ftelemetry-events","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tristanls%2Ftelemetry-events/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tristanls%2Ftelemetry-events/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tristanls%2Ftelemetry-events/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tristanls","download_url":"https://codeload.github.com/tristanls/telemetry-events/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tristanls%2Ftelemetry-events/sbom","scorecard":{"id":899089,"data":{"date":"2025-08-11","repo":{"name":"github.com/tristanls/telemetry-events","commit":"54b8f1ce36e401ec5b7850a6a728edb944daf46b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Code-Review","score":2,"reason":"Found 5/25 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T14:52:10.475Z","repository_id":23451135,"created_at":"2025-08-24T14:52:10.475Z","updated_at":"2025-08-24T14:52:10.475Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32596533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"online","status_checked_at":"2026-05-04T02:00:06.625Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","logging","metrics","nodejs","telemetry","usage"],"created_at":"2024-11-01T19:06:59.198Z","updated_at":"2026-05-04T05:38:53.338Z","avatar_url":"https://github.com/tristanls.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# telemetry-events\n\n_Stability: 2 - [Stable](https://github.com/tristanls/stability-index#stability-2---stable)_\n\n[![NPM version](https://badge.fury.io/js/telemetry-events.png)](http://npmjs.org/package/telemetry-events)\n\nHelper for creating and emitting telemetry events.\n\n## Contributors\n\n[@tristanls](https://github.com/tristanls), [@lpearson05](https://github.com/lpearson05)\n\n## Contents\n\n  * [Installation](#installation)\n  * [Usage](#usage)\n  * [Tests](#tests)\n  * [Documentation](#documentation)\n    * [TelemetryEvents](#telemetryevents)\n  * [Releases](#releases)\n\n## Installation\n\n    npm install telemetry-events\n\n## Usage\n\nTo run the below example run:\n\n    npm run readme\n\n```javascript\n\"use strict\";\n\nvar events = require('events');\nvar pkg = require('../package.json');\nvar TelemetryEvents = require('../index.js');\n\nvar emitter = new events.EventEmitter();\n\nvar telemetry = new TelemetryEvents({emitter: emitter, package: pkg});\n\nemitter.on('telemetry', function (event) {\n    console.dir(event);\n});\n\ntelemetry.emit({type: 'log', level: 'info', message: 'hello info level'});\ntelemetry.emit({type: 'metric', name: 'web requests', target_type: 'counter', unit: 'Req', value: 1});\n\nvar _commonEventData = {\n    method: \"readme\",\n    provenance: [{module: \"my-module\"}]\n};\ntelemetry.emit(_commonEventData,\n{\n    type: \"log\",\n    level: \"info\",\n    message: \"info message using common event data\"\n});\ntelemetry.emit(_commonEventData,\n{\n    type: \"metric\",\n    name: \"metric with common event data\",\n    target_type: \"counter\",\n    unit: \"Call\",\n    value: 1\n});\n\n```\n\n## Tests\n\n    npm test\n\n## Documentation\n\n  * [TelemetryEvents](#telemetryevents)\n\n### TelemetryEvents\n\n**Public API**\n\n  * [new TelemetryEvents(config)](#new-telemetryeventsconfig)\n  * [telemetry.emit(\\[common\\], event)](#telemetryemitcommon-event)\n\n### new TelemetryEvents(config)\n\n  * `config`: _Object_\n    * `package`: _Object_ Contents of `package.json`.\n      * `name`: _String_ Module name.\n      * `version`: _String_ Module version.\n    * `emitter`: _EventEmitter_ _(Default: undefined)_ An optional event emitter to emit events when `emit()` is called.\n    * `eventName`: _String_ _(Default: 'telemetry')_ An optional event name used for event emission if `emitter` is specified.\n\nCreates a new TelemetryEvents instance.\n\n### telemetry.emit([common], event)\n\n  * `common`: _Object_ _(Default: undefined)_ Optional common data to clone and extend with the `event` data.\n  * `event`: _Object_ Event to be emitted.\n  * Return: _Object_ The event.\n\nAdds or extends `event.provenance`. It is worth highlighting that `event.provenance` is a notion similar to a stack in a stack trace. In the case of `telemetry-events`, `event.provenance` is the stack of telemetry emitters. `event.provenance` is not intended to be used as a tracing feature. For tracing see [telemetry-events-trace](https://github.com/tristanls/telemetry-events-trace).\n\nAdds `event.timestamp` if not present.\n\nIf `emit(event)` is given a single argument, it will be treated as `event` and `common` will be `undefined`.\n\nIf `emitter` is not defined, this method does not emit the event. When `emitter` is defined, calling this method will emit the `event` using `eventName`, if provided, or \"telemetry\" (by default).\n\n## Releases\n\nWe follow semantic versioning policy (see: [semver.org](http://semver.org/)):\n\n\u003e Given a version number MAJOR.MINOR.PATCH, increment the:\n\u003e\n\u003eMAJOR version when you make incompatible API changes,\u003cbr/\u003e\n\u003eMINOR version when you add functionality in a backwards-compatible manner, and\u003cbr/\u003e\n\u003ePATCH version when you make backwards-compatible bug fixes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftristanls%2Ftelemetry-events","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftristanls%2Ftelemetry-events","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftristanls%2Ftelemetry-events/lists"}