{"id":23128204,"url":"https://github.com/victorqueiroz/binobject","last_synced_at":"2025-08-17T05:31:26.963Z","repository":{"id":31874881,"uuid":"130000815","full_name":"VictorQueiroz/binobject","owner":"VictorQueiroz","description":"Encode JavaScript objects in binary format with support for native types","archived":false,"fork":false,"pushed_at":"2023-09-27T20:37:52.000Z","size":480,"stargazers_count":7,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-11T10:45:50.079Z","etag":null,"topics":["javascript","json","nodejs"],"latest_commit_sha":null,"homepage":null,"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/VictorQueiroz.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":"2018-04-18T03:50:47.000Z","updated_at":"2023-05-13T04:48:03.000Z","dependencies_parsed_at":"2023-01-14T19:58:26.929Z","dependency_job_id":null,"html_url":"https://github.com/VictorQueiroz/binobject","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/VictorQueiroz/binobject","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VictorQueiroz%2Fbinobject","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VictorQueiroz%2Fbinobject/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VictorQueiroz%2Fbinobject/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VictorQueiroz%2Fbinobject/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VictorQueiroz","download_url":"https://codeload.github.com/VictorQueiroz/binobject/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VictorQueiroz%2Fbinobject/sbom","scorecard":{"id":147949,"data":{"date":"2025-08-11","repo":{"name":"github.com/VictorQueiroz/binobject","commit":"c4e670966e31c42b2f7e1a55c222aaa372d4193a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.9,"checks":[{"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/18 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":"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":"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":-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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 12 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"}},{"name":"Vulnerabilities","score":1,"reason":"9 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T09:47:40.933Z","repository_id":31874881,"created_at":"2025-08-16T09:47:40.934Z","updated_at":"2025-08-16T09:47:40.934Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270810897,"owners_count":24650009,"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-08-17T02:00:09.016Z","response_time":129,"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":["javascript","json","nodejs"],"created_at":"2024-12-17T09:17:43.510Z","updated_at":"2025-08-17T05:31:26.637Z","avatar_url":"https://github.com/VictorQueiroz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# binobject\n\nEasy way to encode / decode JavaScript objects in binary format with support for Date, ArrayBuffer and Node.js Buffer.\n\n## Installation\n```\nyarn add binobject\n```\n\n## Usage\n```js\nimport { ObjectEncoder, ObjectDecoder } from 'binobject';\nimport { randomBytes } from 'crypto';\n\nconst sourceObject = {\n    users: [{\n        name: 'Astrid',\n        birthday: new Date(),\n        uniqueSignature: randomBytes(256)\n    }]\n};\nconst buffer = new ObjectEncoder().encode(sourceObject);\n\nassert.deepEqual(new ObjectDecoder(buffer).decode(), sourceObject);\n```\n\n## Custom types\n\nBoth encoder and decoder class give you the possibility to define custom types for encoding and decoding. All you have to do is create a processor to decode and encode your custom type and then define a value. When defining a custom type it's important not to override a default type, you can check a full list starting from [here](https://github.com/VictorQueiroz/binobject/blob/master/src/constants.ts#L1). Also you need to be aware that currently this library support only up to 255 types (custom types included). See an example bellow:\n\n```ts\nimport { BinaryObject, Processor } from 'binobject';\nimport { ObjectID } from 'mongodb';\nimport { deepEqual } from 'assert';\n\nclass ProcessorObjectID extends Processor\u003cObjectID\u003e {\n    validate(id: any): boolean {\n        return id instanceof ObjectID == true;\n    }\n    decode(buffer: Buffer): ObjectID {\n        return new ObjectID(buffer.toString('hex'));\n    }\n    encode(input: ObjectID): Buffer {\n        return Buffer.from(input.toHexString(), 'hex');\n    }\n}\n\nconst binaryObject = new BinaryObject([{\n    processor: new ProcessorObjectID,\n    value: 60\n}]);\nconst buffer = binaryObject.encode({\n    _id: new ObjectID()\n});\n\ndeepEqual(binaryObject.decode(buffer), {\n    _id: new ObjectID()\n});\n```\n\n## More examples\n\nNeed more examples? Check out our [test.ts](https://github.com/VictorQueiroz/binobject/blob/master/test/test.ts) file","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictorqueiroz%2Fbinobject","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvictorqueiroz%2Fbinobject","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictorqueiroz%2Fbinobject/lists"}