{"id":19509268,"url":"https://github.com/opentmi/opentmi-jsclient","last_synced_at":"2025-06-21T23:03:34.006Z","repository":{"id":25888144,"uuid":"105355383","full_name":"OpenTMI/opentmi-jsclient","owner":"OpenTMI","description":"OpenTMI javascript client for backend\u0026browser","archived":false,"fork":false,"pushed_at":"2025-06-21T20:51:06.000Z","size":2742,"stargazers_count":0,"open_issues_count":43,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-21T23:02:31.644Z","etag":null,"topics":["javascript-client","opentmi"],"latest_commit_sha":null,"homepage":"https://opentmi.github.io/opentmi-jsclient","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,"zenodo":null}},"created_at":"2017-09-30T08:32:49.000Z","updated_at":"2021-11-07T16:42:36.000Z","dependencies_parsed_at":"2023-02-18T04:31:26.384Z","dependency_job_id":"692f17e5-f182-43a2-aeb9-fc6c42ab08e3","html_url":"https://github.com/OpenTMI/opentmi-jsclient","commit_stats":{"total_commits":168,"total_committers":8,"mean_commits":21.0,"dds":0.8035714285714286,"last_synced_commit":"0096d8859391f7bf4995856baf32fdeaa98e064b"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/OpenTMI/opentmi-jsclient","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenTMI%2Fopentmi-jsclient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenTMI%2Fopentmi-jsclient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenTMI%2Fopentmi-jsclient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenTMI%2Fopentmi-jsclient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenTMI","download_url":"https://codeload.github.com/OpenTMI/opentmi-jsclient/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenTMI%2Fopentmi-jsclient/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261206092,"owners_count":23124835,"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","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-client","opentmi"],"created_at":"2024-11-10T23:11:30.571Z","updated_at":"2025-06-21T23:03:28.976Z","avatar_url":"https://github.com/OpenTMI.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eopentmi-jsclient\u003c/h1\u003e\n\n[![npm version](https://img.shields.io/npm/v/opentmi-jsclient.svg)](https://www.npmjs.com/package/opentmi-jsclient)\n[![CircleCI](https://circleci.com/gh/OpenTMI/opentmi-jsclient/tree/master.svg?style=svg)](https://circleci.com/gh/OpenTMI/opentmi-jsclient/tree/master)\n[![Coverage Status](https://coveralls.io/repos/github/OpenTMI/opentmi-jsclient/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/OpenTMI/opentmi-jsclient?branch=master)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n[![License badge](https://img.shields.io/badge/license-MIT-blue.svg)](https://img.shields.io)\n\n\nPromise based [OpenTMI](https://github.com/opentmi/opentmi) javascript client for node.js and browser.\nExtendable for custom API's provided by opentmi addons.\n\n\n## Requirements\n* [opentmi backend](https://github.com/opentmi/opentmi)\n\n## Documentation\n[API documentation](https://opentmi.github.io/opentmi-jsclient/)\n\n## Installation\n\n```\nnpm i opentmi-jsclient\n```\n\n## Build\n\nto build minified version to dist -folder run:\n```\n\u003e npm run build\n```\n\nbuild api documentations\n```\n\u003e npm run doc\n```\n\n**Note:** all available commands are visible when you run: `npm run`\n\n## Sample\n\n### Node.js\n```javascript\nconst {Authentication, Transport, Resources} = require('opentmi-client');\nconst transport = new Transport('http://localhost:3000')\nconst auth = new Authentication(transport);\nauth\n  .login('user@mail.com', 'password')\n  .then(() =\u003e transport.connect())\n  .then(() =\u003e {\n      const collection = new Resources(transport);\n      return collection.find()\n        .haveTag('fantastic')\n        .exec()\n        .then(resources =\u003e resources[0])\n        .then(resource =\u003e {\n          return resource\n            .name('new name')\n            .save();\n        });\n  })\n```\n\n### Browser\n```javascript\n\u003cscript src=\"dist/opentmi-client.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\nconst {Authentication, Transport} = opentmiClient;\nconst transport = new Transport('http://localhost:3000')\nconst auth = new Authentication(transport);\nauth\n  .login('user@mail.com', 'password')\n  .then(() =\u003e transport.connect())\n\u003c/script\u003e\n```\n\n**Note:** see more examples from [sample](sample) -folder.\n\n\n### Customize\n\nIt is easy to create support for custom API's. See example below:\n\n```javascript\nclass CustomAPI {\n  constructor(transport) {\n    this._transport = transport;\n  }\n  some() {\n    debug('attempt to get something from custom addon api');\n    return this._transport\n      .get('/addon-api')\n      .then(response =\u003e response.data);\n  }\n}\nconst customApi = new CustomAPI(transport);\ncustomApi.some().then(data =\u003e console.log(data));\n```\n\n### License\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentmi%2Fopentmi-jsclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopentmi%2Fopentmi-jsclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentmi%2Fopentmi-jsclient/lists"}