{"id":16117921,"url":"https://github.com/wessberg/marshaller","last_synced_at":"2025-06-24T20:11:25.332Z","repository":{"id":66337075,"uuid":"89178391","full_name":"wessberg/marshaller","owner":"wessberg","description":"A lightweight way to serialize and deserialize complex data types non-destructively","archived":false,"fork":false,"pushed_at":"2019-02-09T10:29:48.000Z","size":576,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-24T00:50:25.449Z","etag":null,"topics":["demarshall","deserialization","deserialize","marshall","marshaller","marshalling","serialization","serialize","unmarshall"],"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/wessberg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2017-04-23T23:08:27.000Z","updated_at":"2020-11-17T22:01:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"b9fedcc7-fb9d-44f6-97d7-f4d5aff163ca","html_url":"https://github.com/wessberg/marshaller","commit_stats":null,"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"purl":"pkg:github/wessberg/marshaller","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wessberg%2Fmarshaller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wessberg%2Fmarshaller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wessberg%2Fmarshaller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wessberg%2Fmarshaller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wessberg","download_url":"https://codeload.github.com/wessberg/marshaller/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wessberg%2Fmarshaller/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261749248,"owners_count":23203992,"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":["demarshall","deserialization","deserialize","marshall","marshaller","marshalling","serialization","serialize","unmarshall"],"created_at":"2024-10-09T20:47:46.346Z","updated_at":"2025-06-24T20:11:25.305Z","avatar_url":"https://github.com/wessberg.png","language":"TypeScript","funding_links":["https://www.patreon.com/bePatron?u=11315442"],"categories":[],"sub_categories":[],"readme":"\u003c!-- SHADOW_SECTION_LOGO_START --\u003e\n\n\u003cdiv\u003e\u003cimg alt=\"Logo\" src=\"https://raw.githubusercontent.com/wessberg/marshaller/master/documentation/asset/logo.png\" height=\"180\"   /\u003e\u003c/div\u003e\n\n\u003c!-- SHADOW_SECTION_LOGO_END --\u003e\n\n\u003c!-- SHADOW_SECTION_DESCRIPTION_SHORT_START --\u003e\n\n\u003e A lightweight way to serialize and deserialize complex data types non-destructively\n\n\u003c!-- SHADOW_SECTION_DESCRIPTION_SHORT_END --\u003e\n\n\u003c!-- SHADOW_SECTION_BADGES_START --\u003e\n\n\u003ca href=\"https://npmcharts.com/compare/%40wessberg%2Fmarshaller?minimal=true\"\u003e\u003cimg alt=\"Downloads per month\" src=\"https://img.shields.io/npm/dm/%40wessberg%2Fmarshaller.svg\"    /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/package/%40wessberg%2Fmarshaller\"\u003e\u003cimg alt=\"NPM version\" src=\"https://badge.fury.io/js/%40wessberg%2Fmarshaller.svg\"    /\u003e\u003c/a\u003e\n\u003ca href=\"https://david-dm.org/wessberg/marshaller\"\u003e\u003cimg alt=\"Dependencies\" src=\"https://img.shields.io/david/wessberg%2Fmarshaller.svg\"    /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/wessberg/marshaller/graphs/contributors\"\u003e\u003cimg alt=\"Contributors\" src=\"https://img.shields.io/github/contributors/wessberg%2Fmarshaller.svg\"    /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/prettier/prettier\"\u003e\u003cimg alt=\"code style: prettier\" src=\"https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square\"    /\u003e\u003c/a\u003e\n\u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\u003cimg alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\"    /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.patreon.com/bePatron?u=11315442\"\u003e\u003cimg alt=\"Support on Patreon\" src=\"https://img.shields.io/badge/patreon-donate-green.svg\"    /\u003e\u003c/a\u003e\n\n\u003c!-- SHADOW_SECTION_BADGES_END --\u003e\n\n\u003c!-- SHADOW_SECTION_DESCRIPTION_LONG_START --\u003e\n\n## Description\n\n\u003c!-- SHADOW_SECTION_DESCRIPTION_LONG_END --\u003e\n\nMarshaller provides a lightweight way to serialize and deserialize complex data types non-destructively.\nEssentially, it is `JSON.parse()` and `JSON.stringify` with support for far more data types, circular references, and with the guarantee that\nwhatever is serialized can be deserialized into the exact same representation without losing _any_ information.\n\nYou can consider this to be direct replacements for the `JSON.[stringify|parse]` methods, provided through `marshall` for serialization and `demarshall` for deserialization.\n\n\u003c!-- SHADOW_SECTION_FEATURES_START --\u003e\n\n### Features\n\n\u003c!-- SHADOW_SECTION_FEATURES_END --\u003e\n\n- _\"`JSON.parse`/`JSON.stringify` on steroids\"_\n- Non-destructive serialization/deserialization of data\n- Supports Circular references\n- A wide variety of supported data types - from simple things as strings to complex things such as Maps, Sets and Typed Arrays\n\n\u003c!-- SHADOW_SECTION_FEATURE_IMAGE_START --\u003e\n\n\u003c!-- SHADOW_SECTION_FEATURE_IMAGE_END --\u003e\n\n\u003c!-- SHADOW_SECTION_TOC_START --\u003e\n\n## Table of Contents\n\n- [Description](#description)\n  - [Features](#features)\n- [Table of Contents](#table-of-contents)\n- [Install](#install)\n  - [NPM](#npm)\n  - [Yarn](#yarn)\n- [Supported data types and features](#supported-data-types-and-features)\n- [Usage](#usage)\n- [Contributing](#contributing)\n- [Maintainers](#maintainers)\n- [Backers](#backers)\n  - [Patreon](#patreon)\n- [FAQ](#faq)\n  - [Why are functions not supported](#why-are-functions-not-supported)\n- [License](#license)\n\n\u003c!-- SHADOW_SECTION_TOC_END --\u003e\n\n\u003c!-- SHADOW_SECTION_INSTALL_START --\u003e\n\n## Install\n\n### NPM\n\n```\n$ npm install @wessberg/marshaller\n```\n\n### Yarn\n\n```\n$ yarn add @wessberg/marshaller\n```\n\n\u003c!-- SHADOW_SECTION_INSTALL_END --\u003e\n\n## Supported data types and features\n\n- Anything that is JSON serializable today: `number`, `boolean`, `string`, `array`, `object literal`\n- References, including circular references\n- `RegExp`\n- `Date`\n- `Map`\n- `Set`\n- `Symbol`\n- `BigInt`\n- `undefined`\n- `null`\n- `Int8Array`\n- `Int16Array`\n- `Int32Array`\n- `UInt8Array`\n- `UInt8ClampedArray`\n- `UInt16Array`\n- `UInt32Array`\n- `Float32Array`\n- `Float64Array`\n- `String`\n- `Number`\n- `Boolean`\n\n\u003c!-- SHADOW_SECTION_USAGE_START --\u003e\n\n## Usage\n\n\u003c!-- SHADOW_SECTION_USAGE_END --\u003e\n\n```typescript\nimport {marshall, demarshall} from \"@wessberg/marshaller\";\n\n// Marshall some complex data that wouldn't normally be JSON serializable\nconst marshallResult = marshall({\n\ta: new Set([1, 2, /foo/, {a: new Date(), b: new Float32Array([1, 2, 3])}])\n});\n\n// Demarshall it to get a structurally identical representation back of the data\nconst demarshallResult = demarshall(marshallResult);\n```\n\n\u003c!-- SHADOW_SECTION_CONTRIBUTING_START --\u003e\n\n## Contributing\n\nDo you want to contribute? Awesome! Please follow [these recommendations](./CONTRIBUTING.md).\n\n\u003c!-- SHADOW_SECTION_CONTRIBUTING_END --\u003e\n\n\u003c!-- SHADOW_SECTION_MAINTAINERS_START --\u003e\n\n## Maintainers\n\n| \u003cimg alt=\"Frederik Wessberg\" src=\"https://avatars2.githubusercontent.com/u/20454213?s=460\u0026v=4\" height=\"70\"   /\u003e                   |\n| --------------------------------------------------------------------------------------------------------------------------------- |\n| [Frederik Wessberg](mailto:frederikwessberg@hotmail.com)\u003cbr\u003e[@FredWessberg](https://twitter.com/FredWessberg)\u003cbr\u003e_Lead Developer_ |\n\n\u003c!-- SHADOW_SECTION_MAINTAINERS_END --\u003e\n\n\u003c!-- SHADOW_SECTION_BACKERS_START --\u003e\n\n## Backers\n\n### Patreon\n\n[Become a backer](https://www.patreon.com/bePatron?u=11315442) and get your name, avatar, and Twitter handle listed here.\n\n\u003ca href=\"https://www.patreon.com/bePatron?u=11315442\"\u003e\u003cimg alt=\"Backers on Patreon\" src=\"https://patreon-badge.herokuapp.com/11315442.png\"  width=\"500\"  /\u003e\u003c/a\u003e\n\n\u003c!-- SHADOW_SECTION_BACKERS_END --\u003e\n\n\u003c!-- SHADOW_SECTION_FAQ_START --\u003e\n\n## FAQ\n\n\u003c!-- SHADOW_SECTION_FAQ_END --\u003e\n\n#### Why are functions not supported\n\nFirst, there are security considerations. But more importantly, functions can reference identifiers that lives in a lexical\nenvironment that is declared outside of the local scope of that function. Marshalling this data would require passing in\na sandboxed environment which breaks the promise of the library - simple replacement for JSON, with non-destructive serialization/deserialization.\n\n\u003c!-- SHADOW_SECTION_LICENSE_START --\u003e\n\n## License\n\nMIT © [Frederik Wessberg](mailto:frederikwessberg@hotmail.com) ([@FredWessberg](https://twitter.com/FredWessberg)) ([Website](https://github.com/wessberg))\n\n\u003c!-- SHADOW_SECTION_LICENSE_END --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwessberg%2Fmarshaller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwessberg%2Fmarshaller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwessberg%2Fmarshaller/lists"}