{"id":13447699,"url":"https://github.com/node-modules/serialize-json","last_synced_at":"2025-10-18T23:56:20.322Z","repository":{"id":60775167,"uuid":"80835468","full_name":"node-modules/serialize-json","owner":"node-modules","description":"A serialize algorithm for JSON","archived":false,"fork":false,"pushed_at":"2023-01-06T18:00:04.000Z","size":15,"stargazers_count":25,"open_issues_count":3,"forks_count":4,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-07-15T14:57:24.840Z","etag":null,"topics":["json","nodejs","serialization"],"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/node-modules.png","metadata":{"files":{"readme":"README.md","changelog":"History.md","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":"2017-02-03T14:18:58.000Z","updated_at":"2025-03-12T16:37:01.000Z","dependencies_parsed_at":"2023-02-06T07:30:26.850Z","dependency_job_id":null,"html_url":"https://github.com/node-modules/serialize-json","commit_stats":null,"previous_names":["node-modules/serialize-json"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/node-modules/serialize-json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-modules%2Fserialize-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-modules%2Fserialize-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-modules%2Fserialize-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-modules%2Fserialize-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/node-modules","download_url":"https://codeload.github.com/node-modules/serialize-json/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-modules%2Fserialize-json/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269181012,"owners_count":24373845,"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-06T02:00:09.910Z","response_time":99,"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":["json","nodejs","serialization"],"created_at":"2024-07-31T05:01:24.685Z","updated_at":"2025-10-18T23:56:15.277Z","avatar_url":"https://github.com/node-modules.png","language":"JavaScript","readme":"# serialize-json\nA serialize algorithm for JSON\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![Test coverage][codecov-image]][codecov-url]\n[![David deps][david-image]][david-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n[![npm download][download-image]][download-url]\n\n[npm-image]: https://img.shields.io/npm/v/serialize-json.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/serialize-json\n[travis-image]: https://img.shields.io/travis/node-modules/serialize-json.svg?style=flat-square\n[travis-url]: https://travis-ci.org/node-modules/serialize-json\n[codecov-image]: https://codecov.io/gh/node-modules/serialize-json/branch/master/graph/badge.svg\n[codecov-url]: https://codecov.io/gh/node-modules/serialize-json\n[david-image]: https://img.shields.io/david/node-modules/serialize-json.svg?style=flat-square\n[david-url]: https://david-dm.org/node-modules/serialize-json\n[snyk-image]: https://snyk.io/test/npm/serialize-json/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/serialize-json\n[download-image]: https://img.shields.io/npm/dm/serialize-json.svg?style=flat-square\n[download-url]: https://npmjs.org/package/serialize-json\n\n## Introduction\n\n- Support serialize JSON to Buffer, and deserialize Buffer to JSON\n  - [√] Boolean\n  - [√] String\n  - [√] Number\n  - [√] Null\n  - [√] Undefined\n  - [√] Date\n  - [√] Buffer\n  - [√] Error\n  - [√] Plain Object\n  - [×] Function\n  - [×] RegExp\n  - [×] Symbol\n\n- Inspire by [jsonpack](https://github.com/sapienlab/jsonpack), it can compress to 55% of original size if the data has a recursive structure\n\n## Install\n\n```bash\n$ npm install serialize-json --save\n```\n\nNode.js \u003e= 4.0.0 required\n\n## Usage\n\n```js\nlet json = {\n  a: 'a',\n  b: 123,\n  c: 123.456,\n  d: [ 1, 2, 3 ],\n  e: true,\n  f: null,\n  g: undefined,\n  h: new Date(),\n  i: new Buffer('this is a buffer'),\n  j: new Error('this is a error'),\n};\nconst buf = JSON.encode(json);\nconst result = JSON.decode(buf);\nassert.deepEqual(result, json);\n```\n\n## API\n\n- `encode(json)` serialize a json object\n- `decode(buf)` deserialize a buffer to json\n\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-modules%2Fserialize-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnode-modules%2Fserialize-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-modules%2Fserialize-json/lists"}