{"id":16712937,"url":"https://github.com/gabrielcsapo/json-ex","last_synced_at":"2025-07-24T17:05:18.550Z","repository":{"id":57284814,"uuid":"91897832","full_name":"gabrielcsapo/json-ex","owner":"gabrielcsapo","description":"🧠 extends JSON to be able to serialize and deserialize more than just basic primitives","archived":false,"fork":false,"pushed_at":"2018-01-13T07:10:05.000Z","size":1456,"stargazers_count":2,"open_issues_count":3,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-14T17:45:18.540Z","etag":null,"topics":["extended","json"],"latest_commit_sha":null,"homepage":"https://gabrielcsapo.github.io/json-ex","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/gabrielcsapo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.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-05-20T15:22:58.000Z","updated_at":"2021-05-03T04:04:54.000Z","dependencies_parsed_at":"2022-08-25T07:30:38.951Z","dependency_job_id":null,"html_url":"https://github.com/gabrielcsapo/json-ex","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gabrielcsapo/json-ex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielcsapo%2Fjson-ex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielcsapo%2Fjson-ex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielcsapo%2Fjson-ex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielcsapo%2Fjson-ex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gabrielcsapo","download_url":"https://codeload.github.com/gabrielcsapo/json-ex/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielcsapo%2Fjson-ex/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266490188,"owners_count":23937376,"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-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["extended","json"],"created_at":"2024-10-12T20:44:46.003Z","updated_at":"2025-07-24T17:05:18.445Z","avatar_url":"https://github.com/gabrielcsapo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json-ex\n\n[![Build Status](https://travis-ci.org/gabrielcsapo/json-ex.svg?branch=master)](https://travis-ci.org/gabrielcsapo/json-ex)\n[![Dependency Status](https://starbuck.gabrielcsapo.com/badge/github/gabrielcsapo/json-ex/status.svg)](https://starbuck.gabrielcsapo.com/github/gabrielcsapo/json-ex)\n[![devDependency Status](https://starbuck.gabrielcsapo.com/badge/github/gabrielcsapo/json-ex/dev-status.svg)](https://starbuck.gabrielcsapo.com/github/gabrielcsapo/json-ex#info=devDependencies)\n[![Coverage Status](https://lcov-server.gabrielcsapo.com/badge/github%2Ecom/gabrielcsapo/json-ex.svg)](https://lcov-server.gabrielcsapo.com/coverage/github%2Ecom/gabrielcsapo/json-ex)\n[![npm](https://img.shields.io/npm/dt/json-ex.svg?maxAge=2592000)]()\n[![npm](https://img.shields.io/npm/dm/json-ex.svg?maxAge=2592000)]()\n\n\u003e 🧠 extends JSON to be able to serialize and deserialize more than just basic primitives\n\n# What is this?\n\nLet's parse JSON like it is 20**! Let's add support for functions, buffers, dates and the basic primitives! If you know of anymore let me know and let's add them!\n\n\u003e This is not a recreation of JSON, it is extending the protocol to allow for more types\n\n# Install\n\n```bash\nnpm install json-ex\n```\n\n## Usage\n\n\u003e json-ex is a drop in replacement for JSON, so it implements JSON.stringify and JSON.parse\n\n### Stringify\n\n```javascript\nconst JSONex = require('json-ex');\nconst object = {\n    name: 'Hello world',\n    person: true,\n    age: 100000,\n    buffer: new Buffer('hi'),\n    date: new Date('10/20/2017'),\n    func: function hello() { return 'hello world' },\n    reg: new RegExp('%name%')\n};\nconst output = JSONex.stringify(object);\n```\n\n#### output\n\n```json\n{\n  \"name\": \"Hello world\",\n  \"person\": true,\n  \"age\": 100000,\n  \"buffer\": \"_BuffEx_%7B%22type%22%3A%22Buffer%22%2C%22data%22%3A%5B104%2C105%5D%7D\",\n  \"date\": \"_DateEx_2017-10-20T07%3A00%3A00.000Z\",\n  \"func\": \"_FuncRa_function%20hello()%20%7B%20return%20\u0026#39;hello%20world\u0026#39;%20%7D\",\n  \"reg\": \"_PxEgEr_%5B%22%25name%25%22%2C%22%22%5D\"\n}\n```\n\n### Parse\n\n```javascript\nconst string = `{\n  \"name\": \"Hello world\",\n  \"person\": true,\n  \"age\": 100000,\n  \"buffer\": \"_BuffEx_%7B%22type%22%3A%22Buffer%22%2C%22data%22%3A%5B104%2C105%5D%7D\",\n  \"date\": \"_DateEx_2017-10-20T07%3A00%3A00.000Z\",\n  \"func\": \"_FuncRa_function%20hello()%20%7B%20return%20\u0026#39;hello%20world\u0026#39;%20%7D\",\n  \"reg\": \"_PxEgEr_%5B%22%25name%25%22%2C%22%22%5D\"\n}`;\nconst output = JSONex.parse(string);\n```\n\n### output\n\n```javascript\n{ name: 'Hello world',\n  person: true,\n  age: 100000,\n  buffer: \u003cBuffer 68 69\u003e,\n  date: 2017-10-20T07:00:00.000Z,\n  func: [Function: hello],\n  reg: /%name%/\n}\n```\n\n## Benchmark\n\n\u003e run benchmarks by running `npm run benchmark`\n\n```bash\njson-ex\n  41,763 op/s » Stringify\n 87,266 op/s » Parse\n\n\nSuites:  1\nBenches: 2\nElapsed: 1,760.74 ms\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielcsapo%2Fjson-ex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabrielcsapo%2Fjson-ex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielcsapo%2Fjson-ex/lists"}