{"id":17459160,"url":"https://github.com/bonustrack/kbyte","last_synced_at":"2025-04-28T15:58:47.573Z","repository":{"id":26893330,"uuid":"107814912","full_name":"bonustrack/kbyte","owner":"bonustrack","description":"A lightweight JavaScript library for Obyte","archived":false,"fork":false,"pushed_at":"2024-06-17T20:00:17.000Z","size":696,"stargazers_count":16,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-28T15:58:45.666Z","etag":null,"topics":["byteball","kbyte","obyte","websocket","ws"],"latest_commit_sha":null,"homepage":"https://bonustrack.gitbook.io/kbyte","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bonustrack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"docs/CODE_OF_CONDUCT.md","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":"2017-10-21T20:50:34.000Z","updated_at":"2025-04-09T10:12:17.000Z","dependencies_parsed_at":"2024-10-20T19:49:53.556Z","dependency_job_id":null,"html_url":"https://github.com/bonustrack/kbyte","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bonustrack%2Fkbyte","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bonustrack%2Fkbyte/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bonustrack%2Fkbyte/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bonustrack%2Fkbyte/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bonustrack","download_url":"https://codeload.github.com/bonustrack/kbyte/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251342720,"owners_count":21574244,"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":["byteball","kbyte","obyte","websocket","ws"],"created_at":"2024-10-18T04:45:58.099Z","updated_at":"2025-04-28T15:58:47.551Z","avatar_url":"https://github.com/bonustrack.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm](https://img.shields.io/npm/v/kbyte.svg)](https://www.npmjs.com/package/kbyte)\n[![Try kbyte on RunKit](https://badge.runkitcdn.com/kbyte.svg)](https://runkit.com/bonustrack/kbyte)\n\n# kbyte.js\n\nA lightweight JavaScript library for Obyte\n\n### Install\nkbyte was designed to work both in the browser and in Node.js.\n\n#### Node.js\nTo install kbyte on Node.js, open your terminal and run:\n```\nnpm install kbyte\n```\n\n#### Browser\nYou can create an index.html file and include kbyte with:\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/kbyte\"\u003e\u003c/script\u003e\n```\n\n### Usage\n```js\nvar kbyte = require('kbyte');\n\n// Init WebSocket client\nvar client = new kbyte.Client('wss://obyte.org/bb');\n\n// Get peers\nclient.request('get_peers', null, function(err, result) {\n  console.log(err, result);\n});\n```\n[See more examples](/test/test.ts)\n\n### Promises\n\nYou can also use kbyte with promises by promisifying kbyte with\n[bluebird](https://github.com/petkaantonov/bluebird) as in:\n\n```js\nvar kbyte = require('kbyte');\nbluebird.promisifyAll(kbyte.Client.prototype);\n```\n\nIt'll add a *Async* to all kbyte functions (e.g. return client.requestAsync().then())\nclient.request('get_peers', null, function(err, result) {\n  console.log(err, result);\n});\n```js\n// So instead of writing client.request('get_peers', null, cb); you have to write:\nclient.requestAsync('get_peers', null).then(function(result) {\n  console.log(result); // =\u003e ['wss://byteroll.com/bb', 'wss://byteball.fr/bb' ...]\n});\n```\n\n### License\n\n[MIT](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbonustrack%2Fkbyte","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbonustrack%2Fkbyte","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbonustrack%2Fkbyte/lists"}