{"id":21404716,"url":"https://github.com/eightyfive/koa-request-pjax","last_synced_at":"2026-01-03T22:04:52.844Z","repository":{"id":88370931,"uuid":"45515518","full_name":"eightyfive/koa-request-pjax","owner":"eightyfive","description":"Koa middleware to grab \u0026 set PJAX related headers","archived":false,"fork":false,"pushed_at":"2015-11-26T07:29:43.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-23T13:22:51.909Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eightyfive.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":"2015-11-04T04:37:31.000Z","updated_at":"2015-11-04T06:08:27.000Z","dependencies_parsed_at":"2023-03-12T08:46:48.167Z","dependency_job_id":null,"html_url":"https://github.com/eightyfive/koa-request-pjax","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"f6062b755529e01f492ecab8dbf77b4cc15ffb0b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eightyfive%2Fkoa-request-pjax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eightyfive%2Fkoa-request-pjax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eightyfive%2Fkoa-request-pjax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eightyfive%2Fkoa-request-pjax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eightyfive","download_url":"https://codeload.github.com/eightyfive/koa-request-pjax/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243902291,"owners_count":20366259,"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":[],"created_at":"2024-11-22T16:17:42.482Z","updated_at":"2026-01-03T22:04:52.781Z","avatar_url":"https://github.com/eightyfive.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# koa-request-pjax\nA simple middleware to grab \u0026 set PJAX related headers\n\n## Installation\n\n```\n$ npm install koa-request-pjax --save\n```\n\n## Usage\n\nWhen this is a PJAX request, an `object` is set on the koa request:\n\n```js\nthis.request.pjax = {\n  container: '#content'\n}\n```\n\nYou can alter this `object` to set PJAX response headers automatically:\n\n```js\n// This will set the 'X-PJAX-URL' response header\nthis.request.pjax.url = \"http://localhost:3000/foo/bar\";\n\n// This will set the 'X-PJAX-Version' response header\nthis.request.pjax.version = \"v123\";\n```\n\n## Example\n\n```js\nvar koa = require('koa');\nvar pjax = require('koa-request-pjax');\nvar app = koa();\n\napp.use(pjax());\napp.use(function *(){\n  this.body = 'Hello World';\n  \n  if (this.request.pjax) {\n\n    /**\n      * Do some PJAX-related magic here\n      * ...\n      */\n    \n    this.request.pjax.version = \"v123\";\n    \n    // Etc...\n  }\n});\n\napp.listen(3000);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feightyfive%2Fkoa-request-pjax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feightyfive%2Fkoa-request-pjax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feightyfive%2Fkoa-request-pjax/lists"}