{"id":19509246,"url":"https://github.com/opentmi/opentmi-addon","last_synced_at":"2025-10-12T21:37:39.815Z","repository":{"id":52143682,"uuid":"119155582","full_name":"OpenTMI/opentmi-addon","owner":"OpenTMI","description":"Opentmi Addon class","archived":false,"fork":false,"pushed_at":"2024-04-15T20:39:57.000Z","size":95,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-06T08:37:10.330Z","etag":null,"topics":["opentmi"],"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/OpenTMI.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-27T10:47:16.000Z","updated_at":"2020-03-14T07:24:10.000Z","dependencies_parsed_at":"2024-11-10T23:11:35.794Z","dependency_job_id":"494cbab9-8eae-4277-8cd8-47ec48c4e690","html_url":"https://github.com/OpenTMI/opentmi-addon","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/OpenTMI/opentmi-addon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenTMI%2Fopentmi-addon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenTMI%2Fopentmi-addon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenTMI%2Fopentmi-addon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenTMI%2Fopentmi-addon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenTMI","download_url":"https://codeload.github.com/OpenTMI/opentmi-addon/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenTMI%2Fopentmi-addon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013124,"owners_count":26085232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"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":["opentmi"],"created_at":"2024-11-10T23:11:28.537Z","updated_at":"2025-10-12T21:37:39.786Z","avatar_url":"https://github.com/OpenTMI.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenTMI addon base class\n\nThis module contains base class and utils for OpenTMI addons.\n\n## API\n\n### `Addon`\n\nThis is base class which stores some basic things, like logger instance, eventBus etc.\n\n**getters**\n* `this.logger` to get logger instance\n* `this.eventBus` to get opentmi eventBus instance\n* `this.app` to get opentmi express application instance\n* `this.server` to get express server instance\n* `this.io` to get socket.io instance\n\n\nUsage example:\n\n```\nconst {Addon} = require('opentmi-addon');\n\nclass MyAddon extends Addon {\n    constructor(...data) {\n        super(...data);\n        this.logger.info('MyAddon constructor');\n    }\n}\nmodule.exports = MyAddon;\n```\n\n### `singleton()`\n\nsingleton mixer can be used to create addon which manage some\nbackground operations like analyse results. Those background operations\nis activated when `register` -function is called.\nNote that `register` is called only once even opentmi is started ìn cluster mode.\n\n**getters**\n* `isRegistered`  is true for instance which contains singleton instance\n\nUsage example:\n```\nconst {Addon, singleton} = require('opentmi-addon');\nclass MyAddon extends Addon {\n    constructor(...data) {\n        super(...data);\n        this.logger.info('MyAddon constructor');\n    }\n}\nconst MySingletonAddon = singleton(MyAddon);\nmodule.exports = MySingletonAddon;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentmi%2Fopentmi-addon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopentmi%2Fopentmi-addon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentmi%2Fopentmi-addon/lists"}