{"id":18851589,"url":"https://github.com/eviltik/pinary","last_synced_at":"2026-04-26T16:32:38.141Z","repository":{"id":34867575,"uuid":"185626984","full_name":"eviltik/pinary","owner":"eviltik","description":"RPC client/server over TCP/TLS using binary frames and zlib compression (nodejs)","archived":false,"fork":false,"pushed_at":"2023-03-05T19:55:38.000Z","size":149,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-30T01:23:20.729Z","etag":null,"topics":["binary","jsonrpc","nodejs","stream"],"latest_commit_sha":null,"homepage":"","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/eviltik.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-05-08T14:53:37.000Z","updated_at":"2024-06-14T04:31:00.000Z","dependencies_parsed_at":"2024-12-30T17:02:59.456Z","dependency_job_id":null,"html_url":"https://github.com/eviltik/pinary","commit_stats":{"total_commits":84,"total_committers":2,"mean_commits":42.0,"dds":"0.011904761904761862","last_synced_commit":"08a413da916bfa6698358676dd5cea371f572a7f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eviltik/pinary","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eviltik%2Fpinary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eviltik%2Fpinary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eviltik%2Fpinary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eviltik%2Fpinary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eviltik","download_url":"https://codeload.github.com/eviltik/pinary/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eviltik%2Fpinary/sbom","scorecard":{"id":386855,"data":{"date":"2025-08-11","repo":{"name":"github.com/eviltik/pinary","commit":"08a413da916bfa6698358676dd5cea371f572a7f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/node.js.yml:1","Info: no jobLevel write permissions found"],"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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"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":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/eviltik/pinary/node.js.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/eviltik/pinary/node.js.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 npmCommand dependencies pinned"],"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":"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":"Code-Review","score":0,"reason":"Found 0/28 approved changesets -- score normalized to 0","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":"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":"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":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-w5p7-h5w8-2hfq"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 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-18T16:50:43.976Z","repository_id":34867575,"created_at":"2025-08-18T16:50:43.976Z","updated_at":"2025-08-18T16:50:43.976Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32305035,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T09:34:17.070Z","status":"ssl_error","status_checked_at":"2026-04-26T09:34:00.993Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["binary","jsonrpc","nodejs","stream"],"created_at":"2024-11-08T03:35:21.581Z","updated_at":"2026-04-26T16:32:38.116Z","avatar_url":"https://github.com/eviltik.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pinary\n\n------\n![Node.js CI](https://github.com/eviltik/pinary/workflows/Node.js%20CI/badge.svg)\n[![npm version](https://badge.fury.io/js/pinary.svg)](https://badge.fury.io/js/pinary)\n[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php)\n[![Dependency Status](https://david-dm.org/eviltik/pinary.svg)](https://david-dm.org/eviltik/pinary)\n\n\n## Introduction\n\nYet another RPC client and server, with minimalistic publish/subscribe implementation.\n\n* Server\n  * TCP or TLS, as you want (TLS require certificates, see https://github.com/jfromaniello/selfsigned )\n  * Persistant connection\n  * Binary frames (fast)\n  * Optional ZLIB compression\n  * Minimalistic JSON Schema implementation (input integrity)\n  * Handle Max Clients\n  * Basic publish/subscribe support\n\n* Client\n  * Automatic reconnect\n  * Internal RPC calls queue\n    * Allow lazy client connect\n    * Store calls when not connected and play calls when reconnect\n\n\n## Install\n\n```\nnpm install pinary\n```\n\n## Server\n\n### Server: instantiation\n\n```\nconst PinaryServer = require('pinary').server;\nconst server = new PinaryServer();\n\n// with options (see below)\n// const server = new PinaryServer({port:64000});\n\n```\n\n| Option                | Default                       |  Notes  \n|-----------------------|-------------------------------|----------------\n| useTLS                | false                         | Use clear TCP or TLS    \n| useZLIB               | false                         | Use ZLIB compression\n| maxClients (1)        | 10                            | Maximum number of simultaneous TCP connections\n| timeoutData           | 1000                          | Delay before socket close if no data sent, in milliseconds\n| host                  | 0.0.0.0                       | Listening IP/host\n| port                  | 65000 for TCP, 65001 for TLS  | Listening port\n| key                   | null                          | TLS: private key\n| cert                  | null                          | TLS: public key\n| ca                    | null                          | TLS: certificate authority (string of array of string)\n| secureProtocol        | TLSv1_2_method                | TLS: cipher\n| rejectUnauthorized    | false                         | TLS: allow self signed certificates, or not\n\n(1) under the hood, a \"client\" is in fact 2 sockets, one for writing, one for reading.\n\n\n## Client\n\n### Client: instantiation\n```\nconst PinaryClient = require('pinary').client;\nconst client = new PinaryClient(); // auto connect\n\n// with a TCP url\n// const client = new PinaryClient('tcp://localhost:64000',[options]);\n\n// with a TLS url\n// const client = new PinaryClient('tls://localhost:64000',[options]);\n```\n| Option                                | Default                       | Note |      \n|---------------------------------------|-------------------------------|------|\n| reconnectInterval                     | 500                           | milliseconds   |\n| queueSize                             | 100                           | store rpc calls limit when not connected/disconnected |\n\n### Client: trigger a method\n\n```\n// using callback\nclient.rpc('myMethod', (err, result) =\u003e {\n    if (err) throw err;\n    console.log(result);\n});\n\n// using async/await\nasync function letsgo() {\n    let result;\n    try {\n        result = await client.rpcPromise('myMethod');\n    } catch(e) {\n        // something wrong\n    }\n    console.log(result);\n}\n```\n\nNote: if not yet connected or while the client is trying to reconnect,\nRPC calls are stored in a queue and played when client is connected.\n\n#### Client: events\n\n| event name            | arguments                     |  Notes  \n|-----------------------|-------------------------------|----------------\n| connected             | retryCount                    | if retryCount = 0, first connection, else reconnection  \n| disconnected          |                               |\n| error                 | Error                         |\n\n\n## Publish/Subscribe (PUBSUB)\n\n### Client to clients\n```\nconst Server = require('pinary').server;\nconst Client = require('pinary').client;\n\nconst server = new Server();\nconst client1 = new Client();\nconst client2 = new Client();\n\nconst channel = '/myChannel';\n\nserver.start();\n\nclient1.subscribe('/bla', (data) =\u003e {\n    console.log(data);\n    process.exit();\n});\n\nclient2.publish('/bla', { foo:'bar' });\n\n```\n\n#### Server to clients\n```\nconst Server = require('pinary').server;\nconst Client = require('pinary').client;\n\nconst server = new Server();\nconst client = new Client();\n\nconst channel = '/myChannel';\n\nserver.start();\n\nclient.subscribe(channel, (data) =\u003e {\n    console.log(data);\n    process.exit();\n});\n\nserver.publish(channel, { foo:'bar' });\n```\n\n\nThe actual implementation is minimalistic:\n* a channel is considered as an ID, you cannot use wildcards like redis or faye\n\n\n## TODO\n* finish doc\n  * events emitted (server)\n  * server methods registration (see test/tests/102.methodExist.js, or examples/ for moment)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feviltik%2Fpinary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feviltik%2Fpinary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feviltik%2Fpinary/lists"}