{"id":31943595,"url":"https://github.com/dancecoder/json22-express","last_synced_at":"2026-04-21T10:03:54.760Z","repository":{"id":57285506,"uuid":"456104994","full_name":"dancecoder/json22-express","owner":"dancecoder","description":"Express middleware to support JSON22 data format","archived":false,"fork":false,"pushed_at":"2022-02-06T12:45:22.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-13T23:48:41.398Z","etag":null,"topics":["body-parser","express","express-middleware","expressjs","json22","serialization-format"],"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/dancecoder.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}},"created_at":"2022-02-06T09:20:11.000Z","updated_at":"2022-02-13T10:57:14.000Z","dependencies_parsed_at":"2022-08-25T07:22:30.799Z","dependency_job_id":null,"html_url":"https://github.com/dancecoder/json22-express","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/dancecoder/json22-express","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dancecoder%2Fjson22-express","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dancecoder%2Fjson22-express/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dancecoder%2Fjson22-express/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dancecoder%2Fjson22-express/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dancecoder","download_url":"https://codeload.github.com/dancecoder/json22-express/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dancecoder%2Fjson22-express/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018558,"owners_count":26086405,"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-10-14T02:00:06.444Z","response_time":60,"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":["body-parser","express","express-middleware","expressjs","json22","serialization-format"],"created_at":"2025-10-14T09:59:11.680Z","updated_at":"2025-10-14T09:59:14.991Z","avatar_url":"https://github.com/dancecoder.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSON22-Express\nExpressjs middleware providing support to [JSON22](https://github.com/dancecoder/json22#readme) data format in your applications.\n\n## Features\n* Ready to use [Express](https://expressjs.com/) middleware\n* Parse [JSON22](https://github.com/dancecoder/json22#readme) body content\n* Parse JSON body content\n* Support for `deflate`, `gzip`, `br` content encodings\n* Define Request.json22 method to send [JSON22](https://github.com/dancecoder/json22#readme) serialized data \n* Zero-dependency npm-package (depends on JSON22 only)\n* Both CJS/ESM modules support\n\n## Installation\n```\nnpm install json22-express\n```\nIn your application initialization file add as a middleware\n```javascript\nimport express from 'express'; \nimport { json22express } from 'json22-express'\n\nconst app = express();\napp.use(json22express());\n```\n\nFor old-fashioned applications\n```javascript\nconst express = require('express'); \nconst { json22express } = require('json22-express'); \n\nconst app = express();\napp.use(json22express());\n```\n\n## Configuration\nJSON22-Express middleware support set of configuration options.\n\n### Pass options\n```javascript\nimport express from 'express'; \nimport { json22express } from 'json22-express'\n\nconst app = express();\napp.use(json22express({\n    overrideResponseJsonMethod: true,\n    maxContentLength: 1024 * 1024, // 1 meg\n}));\n```\n\n### Options\n| Option     | Type      | Default | Description                      |\n|:-----------|:----------|---------|:----------------------------------|\n| handleJson | boolean   | false   | Parse JSON content as well as JSON22 |\n| maxContentLength | number | no limit | Prevent from parsing of too large payloads |\n| keepRawAs  | string | do not keep raw body | Define `Request` field name to save payload Buffer to | \n| overrideResponseJsonMethod | boolean | false | Override response json method as well |\n| json22ParseOptions | Json22ParseOptions | empty | Options to be passed to `JSON22.parse()` method |\n| json22StringifyOptions | Json22StringifyOptions | empty | Options to be passed to `JSON22.stringify()` method |\n\n## Usage\n\n```javascript\nimport express from 'express'; \nimport { json22express } from 'json22-express'\n\nconst app = express();\n\napp.use(json22express({\n    overrideResponseJsonMethod: true,\n    maxContentLength: 1024 * 1024, // 1 meg\n}));\n\napp.get('/date', (req, res, next) =\u003e {\n    // Use .json22() method from Response object\n    res.status(200).json22({ date: new Date() });\n    next();\n});\n\napp.get('/json', (req, res, next) =\u003e {\n    // in case overrideResponseJsonMethod is set to true you may use \n    // .json() method to send JSON22 as well\n    res.status(200).json({ date: new Date() });\n    next();\n});\n\napp.get('/deprecated', (req, res, next) =\u003e {\n    // WARNING: don't do this. It is deprecated method interface and in case\n    // you set overrideResponseJsonMethod to true this method will throw an exception\n    res.json(200, { date: new Date() });\n    next();\n});\n\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdancecoder%2Fjson22-express","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdancecoder%2Fjson22-express","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdancecoder%2Fjson22-express/lists"}