{"id":17970252,"url":"https://github.com/hyrious/marshal","last_synced_at":"2025-10-28T07:37:01.820Z","repository":{"id":57117055,"uuid":"371662406","full_name":"hyrious/marshal","owner":"hyrious","description":"Ruby marshal for the browser and Node.js","archived":false,"fork":false,"pushed_at":"2025-01-10T06:44:27.000Z","size":297,"stargazers_count":16,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-24T04:27:45.512Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/hyrious.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2021-05-28T10:20:18.000Z","updated_at":"2025-10-06T09:10:41.000Z","dependencies_parsed_at":"2023-11-29T03:25:38.214Z","dependency_job_id":"96b9ec8e-9e58-4523-8378-2df0e1f05c66","html_url":"https://github.com/hyrious/marshal","commit_stats":{"total_commits":46,"total_committers":1,"mean_commits":46.0,"dds":0.0,"last_synced_commit":"a23eff9ed4cc160b5ef105da9fe57040f00966c0"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/hyrious/marshal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyrious%2Fmarshal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyrious%2Fmarshal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyrious%2Fmarshal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyrious%2Fmarshal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyrious","download_url":"https://codeload.github.com/hyrious/marshal/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyrious%2Fmarshal/sbom","scorecard":{"id":475749,"data":{"date":"2025-08-11","repo":{"name":"github.com/hyrious/marshal","commit":"6e245659718c07eb39a0a81d181882dbfc92eed9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"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":"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":"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":"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":"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":"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/ci.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/hyrious/marshal/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/hyrious/marshal/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/hyrious/marshal/npm-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/hyrious/marshal/npm-publish.yml/main?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   2 out of   2 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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'contents' permission set to 'read': .github/workflows/npm-publish.yml:11","Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/npm-publish.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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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":"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 'main'"],"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":7,"reason":"3 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99"],"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-19T15:15:18.094Z","repository_id":57117055,"created_at":"2025-08-19T15:15:18.094Z","updated_at":"2025-08-19T15:15:18.094Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281403403,"owners_count":26495042,"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-28T02:00:06.022Z","response_time":60,"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-29T15:02:29.714Z","updated_at":"2025-10-28T07:37:01.796Z","avatar_url":"https://github.com/hyrious.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @hyrious/marshal\n\n![version](https://img.shields.io/npm/v/%40hyrious/marshal)\n![npm package size](https://img.shields.io/bundlephobia/min/%40hyrious/marshal)\n![downloads](https://img.shields.io/npm/dw/%40hyrious/marshal)\n\nRuby marshal for the browser and Node.js.\n\n## Install\n\n```\nnpm add @hyrious/marshal\n```\n\n## Usage\n\n```ts\nimport { dump, load } from \"@hyrious/marshal\";\ndump(null); // Uint8Array(3) [ 4, 8, 48 ]\nload(\"\\x04\\b0\"); // null\n\n// in Node.js\nload(fs.readFileSync(\"data\"));\n\n// in Browser\nload(await file.arrayBuffer());\n```\n\n### Ruby \u0026harr; JavaScript\n\n| Ruby         | JavaScript                             |\n| ------------ | -------------------------------------- |\n| `nil`        | `null`                                 |\n| `\"string\"`   | `\"string\"`                             |\n| `:symbol`    | `Symbol(\"symbol\")`                     |\n| `123456`     | `123456` (number)                      |\n| `123.456`    | `123.456` (number)                     |\n| `/cat/im`    | `/cat/im` (RegExp)                     |\n| `[]`         | `[]`                                   |\n| `{}`         | `{}` (plain object)                    |\n| `Object.new` | `RubyObject { class: Symbol(object) }` |\n\n#### String\n\nBecause users may store binary data that cannot be decoded as UTF-8 in Ruby,\nstrings are decoded into `Uint8Array` firstly, then converted to `string`\nusing `TextDecoder` if seeing an instance variable indicating the encoding.\n\n```js\nload('\\x04\\b\"\\0'); //=\u003e Uint8Array []\nload('\\x04\\bI\"\\0\\x06:\\x06ET'); //=\u003e \"\"\n```\n\nThe special instance variables are:\n\n| name        | value        | encoding      |\n| ----------- | ------------ | ------------- |\n| `:E`        | true / false | UTF-8 / ASCII |\n| `:encoding` | \"enc\"        | enc           |\n\nSo for strict compatibility, you should check if a string is Uint8Array before using it:\n\n```js\nvar a = load(data);\nif (a instanceof Uint8Array) a = decode(a); // if you know it must be a string\nif (typeof a === \"string\") do_something(a);\n```\n\nOr you can use `options.string` to control the behavior, see [options.string](./docs/api.md#optionsstring-utf8--binary).\n\n#### Symbols\n\nSymbols are always decoded in UTF-8 even if they may have other encodings.\nYou can use `Symbol.keyFor(sym)` in JavaScript to get the symbol name in string.\n\n#### RegExp\n\nOnly `i` (ignore case) and `m` (multi-line) flags are preserved.\nHowever, it is still possible to read all flags by wrapper class, see [options.regexp](./docs/api.md#optionsregexp-wrap).\n\n#### Hash\n\nThis library decodes Hash as plain object by default, string/symbol/number\nkeys are always decoded as JS object props, which means unusual keys like\nan object are ignored. However, it is still possible to keep these keys\nusing `Map` or wrapper classes, see [options.hash](./docs/api.md#optionshash-map--wrap).\n\n#### Instance Variables\n\nThis library decodes instance variables (often `@a = 1`) as object props, i.e. `obj[Symbol(@a)] = 1`.\nIt is guaranteed that you can retrieve these properties using `Object.getOwnPropertySymbols()`.\nIt is possible to convert these symbols to strings, see [options.ivarToString](./docs/api.md#optionsivartostring-true--string).\n\n### [API Reference](./docs/api.md)\n\n### [FAQ](./docs/faq.md)\n\n### [ChangeLog](./CHANGELOG.md)\n\n### Develop\n\n- Run `npm t` to run tests.\n- Run `npm t clone` to only run `clone.ts`.\n\n### Reference\n\n- [marshal.c](https://github.com/ruby/ruby/blob/master/marshal.c)\n- [Marshal Format](https://github.com/ruby/ruby/blob/master/doc/marshal.rdoc) (official doc)\n- [node marshal](https://github.com/clayzermk1/node-marshal)\n- [@qnighy/marshal](https://github.com/qnighy/marshal-js)\n- A [little](http://jakegoulding.com/blog/2013/01/15/a-little-dip-into-rubys-marshal-format)/[another](http://jakegoulding.com/blog/2013/01/16/another-dip-into-rubys-marshal-format)/[final](http://jakegoulding.com/blog/2013/01/20/a-final-dip-into-rubys-marshal-format) dip into Ruby's Marshal format\n\n## License\n\nMIT @ [hyrious](https://github.com/hyrious)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyrious%2Fmarshal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyrious%2Fmarshal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyrious%2Fmarshal/lists"}