{"id":13494466,"url":"https://github.com/fabiospampinato/siero","last_synced_at":"2025-10-06T21:27:28.095Z","repository":{"id":220006198,"uuid":"737305349","full_name":"fabiospampinato/siero","owner":"fabiospampinato","description":"A serialization library that can handle functions, promises and symbols too.","archived":false,"fork":false,"pushed_at":"2024-03-29T19:55:57.000Z","size":147,"stargazers_count":94,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-31T09:36:51.235Z","etag":null,"topics":["deserialize","function","promise","serialize","worker"],"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/fabiospampinato.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"fabiospampinato","custom":"https://www.paypal.me/fabiospampinato"}},"created_at":"2023-12-30T14:55:12.000Z","updated_at":"2024-07-25T01:04:58.000Z","dependencies_parsed_at":"2024-02-01T21:56:17.235Z","dependency_job_id":"4df66d57-d5f7-4fb7-a602-ea10cddd9f14","html_url":"https://github.com/fabiospampinato/siero","commit_stats":null,"previous_names":["fabiospampinato/siero"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fsiero","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fsiero/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fsiero/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fsiero/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabiospampinato","download_url":"https://codeload.github.com/fabiospampinato/siero/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227817017,"owners_count":17824200,"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":["deserialize","function","promise","serialize","worker"],"created_at":"2024-07-31T19:01:25.299Z","updated_at":"2025-10-06T21:27:23.042Z","avatar_url":"https://github.com/fabiospampinato.png","language":"TypeScript","funding_links":["https://github.com/sponsors/fabiospampinato","https://www.paypal.me/fabiospampinato"],"categories":["TypeScript"],"sub_categories":[],"readme":"# Siero\n\nA serialization library that can handle functions, promises and symbols too.\n\nIn general arbitrary functions/promises/symbols can't be transferred between workers/processes/VMs, but this library enables you to do the next best thing: by having the two execution contexts communicate with each other you can write code as if functions/promises/symbols got actually transferred between them.\n\nCheck out [`siero-worker`](https://github.com/fabiospampinato/siero-worker) for an opinionated way to spawn a worker that you can talk to via Siero.\n\n## Limitations\n\n- Symbols that are created independently in two realms, without `Symbol.for`, won't be equal to each other.\n- Symbol properties are only preserved if attached to plain objects.\n- Arbitrary custom properties are also only preserved if attached to plain objects.\n- Prevent-extension/sealed/frozen flags are also only preserved for plain objects.\n- Custom configurable/enumerable/writable flags for properties are not preserved at all.\n- Getter/setter properties are not preserved as functions, they will instead be resolved.\n- For error objects only the `name`, `message`, `stack`, `cause` and `errors` properties are preserved.\n- The specific type of function constructor (regular, arrow, async etc.) is not preserved.\n- Deserialized functions will always return a Promise, even if the original function didn't.\n- Generators and async generators are not currently serializable.\n\n## Install\n\n```sh\nnpm install --save siero\n```\n\n## Supported Types\n\n| Primitives       | Boxed Primitives | Errors                 | Typed Arrays              | Others              |\n| ---------------- | ---------------- | ---------------------- | ------------------------- | ------------------- |\n| [`BigInt`][0]    | [`BigInt`][0]    | [`Error`][6]           | [`BigInt64Array`][13]     | [`Array`][24]       |\n| [`Boolean`][1]   | [`Boolean`][1]   | [`EvalError`][7]       | [`BigUint64Array`][14]    | [`ArrayBuffer`][25] |\n| [`Null`][2]      | [`Number`][3]    | [`RangeError`][8]      | [`Float32Array`][15]      | [`DataView`][34]    |\n| [`Number`][3]    | [`String`][4]    | [`ReferenceError`][9]  | [`Float64Array`][16]      | [`Date`][26]        |\n| [`String`][4]    | [`Symbol`][31]   | [`SyntaxError`][10]    | [`Int8Array`][17]         | [`Function`][32]    |\n| [`Symbol`][31]   |                  | [`TypeError`][11]      | [`Int16Array`][18]        | [`Promise`][33]     |\n| [`Undefined`][5] |                  | [`URIError`][12]       | [`Int32Array`][19]        | [`RegExp`][27]      |\n|                  |                  | [`AggregateError`][35] | [`Uint8Array`][20]        | [`Map`][28]         |\n|                  |                  |                        | [`Uint16Array`][21]       | [`Set`][29]         |\n|                  |                  |                        | [`Uint32Array`][22]       | [`PlainObject`][30] |\n|                  |                  |                        | [`Uint8ClampedArray`][23] |                     |\n\n[0]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt\n[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean\n[2]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null\n[3]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number\n[4]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\n[5]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Undefined\n[31]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol\n\n[6]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error\n[7]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError\n[8]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError\n[9]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError\n[10]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError\n[11]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError\n[12]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError\n[35]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError\n\n[13]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array\n[14]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array\n[15]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array\n[16]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array\n[17]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array\n[18]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array\n[19]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array\n[20]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\n[21]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array\n[22]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array\n[23]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray\n\n[24]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array\n[25]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\n[26]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date\n[27]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp\n[28]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map\n[29]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set\n[30]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\n[32]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions\n[33]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise\n[34]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView\n\n## Usage\n\n```ts\nimport {serialize, deserialize} from 'siero';\n\n// Let's serialize a supported value\n\nconst value = { whatever: 123 }; // Any supported value\nconst serialized = serialize ( value );\n\n// Let's deserialize it\n\nconst deserialized = deserialize ( serialized );\n```\n\n## License\n\nMIT © Fabio Spampinato\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiospampinato%2Fsiero","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabiospampinato%2Fsiero","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiospampinato%2Fsiero/lists"}