{"id":20725320,"url":"https://github.com/l-chris/yar-node","last_synced_at":"2025-03-11T08:44:28.294Z","repository":{"id":35146274,"uuid":"212538479","full_name":"L-Chris/yar-node","owner":"L-Chris","description":"Yar implemention for Nodejs.","archived":false,"fork":false,"pushed_at":"2022-12-04T14:27:43.000Z","size":153,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-17T23:29:10.837Z","etag":null,"topics":["node","yar"],"latest_commit_sha":null,"homepage":"https://github.com/laruence/yar","language":"TypeScript","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/L-Chris.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":"2019-10-03T09:09:09.000Z","updated_at":"2023-03-17T12:19:19.000Z","dependencies_parsed_at":"2023-01-15T14:45:40.061Z","dependency_job_id":null,"html_url":"https://github.com/L-Chris/yar-node","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/L-Chris%2Fyar-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/L-Chris%2Fyar-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/L-Chris%2Fyar-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/L-Chris%2Fyar-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/L-Chris","download_url":"https://codeload.github.com/L-Chris/yar-node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243004091,"owners_count":20220236,"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":["node","yar"],"created_at":"2024-11-17T04:18:20.699Z","updated_at":"2025-03-11T08:44:28.256Z","avatar_url":"https://github.com/L-Chris.png","language":"TypeScript","readme":"## yar-node\n\n### ✨ Features:\n- client[√]\n- server[√]\n- packager: json[√]、php[√]、msgpack[×]\n- protocol: http[√]、tcp[×]、unix[×]\n\n### Server\n```javascript\nconst { YarServer } = require('yar-node');\n\nclass API {\n  someMethod(args) {}\n}\n\nconst server = new YarServer(new API());\n\nserver.handle();\n```\n\n### Client\n```javascript\nconst { YarClient } = require('yar-node');\n\nconst client = new YarClient('http://host/api/');\n\nclient.call('someMethod', { name: 'Chris' }).then(res =\u003e {\n  console.log(`reponse:${res}`);\n});\n```\n\n### Yar Header\n```C\ntypedef struct _yar_header {\n  unsigned int   id;            // transaction id\n  unsigned short version;       // protocl version\n  unsigned int   magic_num;     // default is: 0x80DFEC60\n  unsigned int   reserved;\n  unsigned char  provider[32];  // reqeust from who\n  unsigned char  token[32];     // request token, used for authentication\n  unsigned int   body_len;      // request body len\n}\n```\n\n### Request\n```javascript\n{\n  i: '', // transaction id\n  m: '', // the method which being called\n  p: {} // parameters\n}\n```\n\n### Response\n```javascript\n{\n  i: '', // transaction id\n  s: '', // status\n  r: '', // return value\n  o: '', // output\n  e: ''  // error or exception\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl-chris%2Fyar-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fl-chris%2Fyar-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl-chris%2Fyar-node/lists"}