{"id":15168683,"url":"https://github.com/lkwr/ejson","last_synced_at":"2026-01-22T19:48:48.705Z","repository":{"id":62422710,"uuid":"482038346","full_name":"lkwr/ejson","owner":"lkwr","description":"Implementation of Extended JSON (EJSON) in Deno.","archived":false,"fork":false,"pushed_at":"2022-04-15T18:27:53.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-20T08:59:01.887Z","etag":null,"topics":["deno","deno-module","denoland","ejson","json"],"latest_commit_sha":null,"homepage":"https://deno.land/x/ejson","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/lkwr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-15T17:42:38.000Z","updated_at":"2022-04-15T18:24:50.000Z","dependencies_parsed_at":"2022-11-01T17:31:33.062Z","dependency_job_id":null,"html_url":"https://github.com/lkwr/ejson","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/lkwr/ejson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkwr%2Fejson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkwr%2Fejson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkwr%2Fejson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkwr%2Fejson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lkwr","download_url":"https://codeload.github.com/lkwr/ejson/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lkwr%2Fejson/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28669698,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T19:36:09.361Z","status":"ssl_error","status_checked_at":"2026-01-22T19:36:05.567Z","response_time":144,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["deno","deno-module","denoland","ejson","json"],"created_at":"2024-09-27T06:40:24.328Z","updated_at":"2026-01-22T19:48:48.686Z","avatar_url":"https://github.com/lkwr.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### NOTICE: This project is currently experimental and may not work properly!\n\n# EJSON\n\n#### Implementation of Extended JSON (EJSON) in Deno. You can use it for example in MongoDB DataAPI.\n\n![Made for Deno](https://img.shields.io/badge/made%20for-Deno-6B82F6?style=flat-square)\n![Licence MIT](https://img.shields.io/github/license/lkwr/ejson?color=blue\u0026style=flat-square)\n![Latest version](https://img.shields.io/github/v/tag/lkwr/ejson?color=informational\u0026label=version\u0026sort=semver\u0026style=flat-square)\n![Latest commit](https://img.shields.io/github/last-commit/lkwr/ejson?style=flat-square)\n![Status WIP](https://img.shields.io/badge/status-WIP-red?style=flat-square)\n\n## Key Features\n\n- Made for [Deno](https://deno.land)\n  - works with [Deno Deploy](https://deno.com/deploy)\n- Pure Typescript\n- Lightweight\n- Extendable\n- Zero _third party_ dependencies (only deno_std)\n\n## How To Use\n\nCurrently there are no built-in types. But this is planned for the future but\nuntil then you can implement it yourself (or open a merge request 🤠 )\n\n```ts\nimport * as EJSON from 'https://deno.land/x/ejson/mod.ts';\nimport * as Base64 from 'https://deno.land/std@0.135.0/encoding/base64.ts';\n\n// Add date extention\nEJSON.addEncoder(Date, (date) =\u003e {\n    return { $date: { $numberLong: date.getTime().toString() } };\n});\nEJSON.addDecoder('$date', (obj) =\u003e {\n    const num = Number.parseInt(obj.$numberLong);\n    return new Date(num);\n});\n\n// Add Uint8Array extention\nEJSON.addEncoder(Uint8Array, (buffer) =\u003e {\n    return { $binary: { base64: Base64.encode(buffer) } };\n});\nEJSON.addDecoder('$binary', (obj) =\u003e {\n    return Base64.decode(obj.base64);\n});\n\nconst obj = [new Date(), { myBin: new Uint8Array([0xff, 0x7f]) }];\nconsole.log('obj', obj);\n// obj [ 2022-04-15T18:06:07.820Z, { myBin: Uint8Array(2) [ 255, 127 ] } ]\n\nconst stringified = EJSON.stringify(obj);\nconsole.log('stringified', stringified);\n// stringified [{\"$date\":{\"$numberLong\":\"1650045944276\"}},{\"myBin\":{\"$binary\":{\"base64\":\"/38=\"}}}]\n\nconst parsed = EJSON.parse(stringified);\nconsole.log('parsed', parsed);\n// parsed [ 2022-04-15T18:06:00.332Z, { myBin: Uint8Array(2) [ 255, 127 ] } ]\n```\n\n## TODO\n\n- add built-in types\n\n## Known issues\n\n--\n\n## Contributing\n\nFeel free to open merge requests!\n\n## License\n\nMIT\n\n---\n\n\u003e Homepage [luke.id](https://luke.id) \u0026nbsp;\u0026middot;\u0026nbsp; GitHub\n\u003e [@lkwr](https://github.com/lkwr) \u0026nbsp;\u0026middot;\u0026nbsp; Twitter\n\u003e [@wlkrlk](https://twitter.com/wlkrlk)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flkwr%2Fejson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flkwr%2Fejson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flkwr%2Fejson/lists"}