{"id":16834682,"url":"https://github.com/mscdex/xfer","last_synced_at":"2025-10-10T22:47:31.110Z","repository":{"id":57401332,"uuid":"2158755","full_name":"mscdex/xfer","owner":"mscdex","description":"Simple binary TLV reader/writer for node.js","archived":false,"fork":false,"pushed_at":"2014-02-03T06:31:39.000Z","size":216,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-19T23:58:59.382Z","etag":null,"topics":[],"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/mscdex.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":"2011-08-05T05:19:08.000Z","updated_at":"2024-04-07T20:49:34.000Z","dependencies_parsed_at":"2022-09-19T04:51:12.263Z","dependency_job_id":null,"html_url":"https://github.com/mscdex/xfer","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/mscdex/xfer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscdex%2Fxfer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscdex%2Fxfer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscdex%2Fxfer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscdex%2Fxfer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mscdex","download_url":"https://codeload.github.com/mscdex/xfer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscdex%2Fxfer/sbom","scorecard":{"id":665362,"data":{"date":"2025-08-11","repo":{"name":"github.com/mscdex/xfer","commit":"27a2334a49b81c520c3bcbf52a4a877ed0f482f9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"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/30 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":"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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"}}]},"last_synced_at":"2025-08-21T17:49:53.642Z","repository_id":57401332,"created_at":"2025-08-21T17:49:53.643Z","updated_at":"2025-08-21T17:49:53.643Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005459,"owners_count":26083902,"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-10T02:00:06.843Z","response_time":62,"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":[],"created_at":"2024-10-13T12:07:22.348Z","updated_at":"2025-10-10T22:47:31.077Z","avatar_url":"https://github.com/mscdex.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Description\n===========\n\nxfer is a module for [node.js](http://nodejs.org/) that reads and writes binary-compatible messages using a simple TLV-like protocol.\n\n\nRequirements\n============\n\n* [node.js](http://nodejs.org/) -- v0.10.0 or newer\n\n\nInstall\n=======\n\n    npm install xfer\n\n\nExample\n=======\n```javascript\n  var net = require('net'),\n      inspect = require('util').inspect,\n      Xfer = require('./xfer');\n\n  function makeDisplay(role, kind) {\n    return function(arg1, arg2) {\n      var type, stream;\n      if (kind === true) {\n        type = arg1;\n        stream = arg2;\n      } else {\n        type = kind;\n        stream = arg1;\n      }\n      if (!stream)\n        console.log('[' + role + '] Type: ' + type + ', Data: (none)');\n      else {\n        var s = '';\n        stream.on('data', function(d) { s += d; })\n              .on('end', function() {\n                console.log('[' + role + '] Type: ' + type + ', Data: ' + inspect(s));\n              });\n      }\n    };\n  }\n\n  net.createServer(function(client) {\n    this.close();\n    client.xfer = new Xfer();\n    client.pipe(client.xfer).pipe(client);\n\n    client.xfer.on('*', makeDisplay('SERVER', true));\n\n    client.xfer.send(0x01, 'Node.js rules! :-)');\n    client.xfer.send(0x05);\n  }).listen(8118, function() {\n    var client = net.createConnection(8118);\n    client.xfer = new Xfer();\n    client.pipe(client.xfer).pipe(client);\n\n    client.xfer.on(0x01, makeDisplay('CLIENT', 0x01))\n               .on(0x05, makeDisplay('CLIENT', 0x05));\n    client.on('connect', function() {\n      client.xfer.send(0xFF, 'I am caught by the catch-all event!');\n      client.end();\n    });\n  });\n\n  // output:\n  //\n  // [CLIENT] Type: 5, Data: (none)\n  // [CLIENT] Type: 1, Data: 'Node.js rules! :-)'\n  // [SERVER] Type: 255, Data: 'I am caught by the catch-all event!'\n```\n\n\nAPI\n===\n\n_Xfer_ is a _Duplex_ stream\n\nXfer Events\n-----------\n\nTwo types of events are emitted from an Xfer instance: integer (type) events and a special catch-all event ('*').\n\nInteger (type) events are passed a Readable stream object if there was data with the message. The catch-all ('*') event is passed an additional argument (\u003c _integer_ \u003e type) before the stream object.\n\n\nXfer Methods\n------------\n\n * *constructor* ([\u003c _object_ \u003econfig]) - Creates and returns a new Xfer instance with the following valid `config` settings:\n\n    * **highWaterMark** - _integer_ - The high water mark (in bytes) used for backpressure handling for this Xfer instance (default: 128KB)\n\n    * **streamHWM** - _integer_ - The high water mark (in bytes) used for the data streams for inbound messages (default: `highWaterMark` value from above)\n\n    * **skipWriteTick** - _boolean_ - This disables the use of process.nextTick() inside node core's Writable stream class after data is written to this xfer instance. This can help prevent exceeding the maximum call stack if you run into that issue. (default: false)\n\n * **send** (\u003c _integer_ \u003etype[, \u003c _mixed_ \u003edata]) - _boolean_ - Writes the message to the Readable stream portion of the Xfer instance. If provided, `data` can be either a Buffer or string. The return value indicates whether or not more sends should be performed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmscdex%2Fxfer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmscdex%2Fxfer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmscdex%2Fxfer/lists"}