{"id":18317945,"url":"https://github.com/idiocc/goa","last_synced_at":"2025-07-23T14:05:22.375Z","repository":{"id":57113714,"uuid":"184892794","full_name":"idiocc/goa","owner":"idiocc","description":"The Koa Fork Optimised By Google Closure Compiler With Just 1 Dependency.","archived":false,"fork":false,"pushed_at":"2020-03-12T03:45:30.000Z","size":866,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-27T09:18:35.049Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.idio.cc","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/idiocc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-04T12:37:17.000Z","updated_at":"2020-03-12T03:45:32.000Z","dependencies_parsed_at":"2022-08-22T05:31:20.795Z","dependency_job_id":null,"html_url":"https://github.com/idiocc/goa","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiocc%2Fgoa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiocc%2Fgoa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiocc%2Fgoa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idiocc%2Fgoa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idiocc","download_url":"https://codeload.github.com/idiocc/goa/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054218,"owners_count":21039951,"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-05T18:07:56.787Z","updated_at":"2025-04-09T13:51:50.199Z","avatar_url":"https://github.com/idiocc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @goa/koa\n\n[![npm version](https://badge.fury.io/js/%40goa%2Fgoa.svg)](https://www.npmjs.com/package/@goa/goa)\n\nThis is the source code for the `@goa/koa` repository that actually compiles this source code. Please navigate there for the documentation.\n\n\u003cimg src=\"doc/ic.png\" alt=\"Compiled Source Code In 2400 lines.\" align=\"right\"\u003e\n\n`@goa/goa` is the [Koa web-sever](https://koajs.com) compiled and optimised with _Google Closure Compiler_ so that it has only 1 dependency (`mime-db`, for easy access to upgrades). The types are written as _JSDoc_ and don't require installing typings. The aim of this project is to demonstrate how to modernise old-school NPM packages, including starting to use import/export statements without _Babel_, restoring to pure _JSDoc_ without TypeScript, and compiling the code into a single executable using the compiler, and testing the code with [_Zoroaster_](https://contexttesting.com) testing framework which is twice as fast and weighs 500KB against 50MB compared with _Jest_ (as used to be used in the original repository).\n\n\n```sh\nyarn add @goa/goa\n```\n\n## Table Of Contents\n\n- [Table Of Contents](#table-of-contents)\n- [Goa](#goa)\n- [Types](#types)\n- [Packages](#packages)\n- [Tests](#tests)\n- [Copyright \u0026 License](#copyright--license)\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\n  \u003cimg src=\"/.documentary/section-breaks/0.svg?sanitize=true\"\u003e\n\u003c/a\u003e\u003c/p\u003e\n\n## Goa\n\nGoa is the same application as _Koa_. It has the same interface for the app object, as well as context, request and response API.\n\n\u003ctable\u003e\n\u003ctr\u003e\u003cth\u003e\u003ca href=\"example/index.js\"\u003eSource\u003c/th\u003e\u003cth\u003eOutput\u003c/th\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\n\n```js\nimport Goa from '@goa/goa'\n\nconst app = new Goa()\napp.use((ctx) =\u003e {\n  ctx.body = 'hello world'\n})\n```\n\u003c/td\u003e\n\u003ctd\u003e\n\n```\nhello world\n```\n\u003c/td\u003e\u003c/tr\u003e\n\u003c/table\u003e\n\n## Types\n\nThe types detailed information can be found \u003ckbd\u003e📙 [in Wiki](../../wiki)\u003c/kbd\u003e. The Koa documentation can be found on its page.\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\n  \u003cimg src=\"/.documentary/section-breaks/1.svg?sanitize=true\"\u003e\n\u003c/a\u003e\u003c/p\u003e\n\n## Packages\n\nKoa dependencies as packages had to be rewritten in ES6. Some of them were created as separate packages, and some were included in the source code (repository) in the `modules` directory.\n\n\u003cdetails\u003e\n\u003csummary\u003eShow included modules (updated to ES6 and annotated for \u003ca href=\"https://compiler.page\"\u003eNode.JS Compiler)\u003c/a\u003e.\n\u003c/summary\u003e\n\n|      Dependency       |  Type  |\n| --------------------- | ------ |\n| `cache-content-type` | module |\n| `content-disposition` | module |\n| `delegates` | module |\n| `ee-first` | module |\n| `error-inject` | module |\n| `escape-html` | module |\n| `fresh` | module |\n| `http-assert` | module |\n| `koa-is-json` | module |\n| `on-finished` | module |\n| `only` | module |\n| `parseurl` | module |\n\u003c/details\u003e\n\nThe external modules were created with tests also written to ensure their source and compiled versions work as expected.\n\n|                                        Dependency                                        | Dep  |                            Description                             |\n| ---------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------------ |\n| [`@goa/accepts`](https://www.npmjs.com/package/@goa/accepts)    | dev  | Higher-Level Content Negotiation.                                  |\n| [`@goa/content-type`](https://www.npmjs.com/package/@goa/content-type) | dev  | Create and parse HTTP Content-Type header according to RFC 7231.   |\n| [`@goa/cookies`](https://www.npmjs.com/package/@goa/cookies)    | dev  | Signed And Unsigned Cookies Based On Keygrip.                      |\n| [`@goa/is-generator-function`](https://www.npmjs.com/package/@goa/is-generator-function) | dev  | Checks If The Function Is An ES6 Generator.                        |\n| [`@goa/mime-types`](https://www.npmjs.com/package/@goa/mime-types) | dev  | The Ultimate Javascript Content-Type Utility.                      |\n| [`@goa/negotiator`](https://www.npmjs.com/package/@goa/negotiator) | dev  | HTTP Content Negotiation.                                          |\n| [`@goa/type-is`](https://www.npmjs.com/package/@goa/type-is)    | dev  | Infer The Content-Type Of A Request.                               |\n| [`@goa/vary`](https://www.npmjs.com/package/@goa/vary)       | dev  | Manipulate The HTTP Vary header.                                   |\n| [`@goa/compose`](https://www.npmjs.com/package/@goa/compose)    | dev  | Compose a single middleware function for Goa out of many.          |\n| [`@goa/http-errors`](https://www.npmjs.com/package/@goa/http-errors) | dev  | Creates HTTP Errors For Goa Apps.                                  |\n| [`@goa/statuses`](https://www.npmjs.com/package/@goa/statuses)   | dev  | HTTP status utility..                                              |\n| [`@idio/debug`](https://www.npmjs.com/package/@idio/debug)     | dev  | Log Debugging Information.                                         |\n| `mime-db`                                                  | prod | Required for `@goa/mime-types`, `@goa/accepts` and `@goa/type-is`. |\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\n  \u003cimg src=\"/.documentary/section-breaks/2.svg?sanitize=true\"\u003e\n\u003c/a\u003e\u003c/p\u003e\n\n## Tests\n\nThe tests were updated for [context testing](https://contexttesting.com) and include all original Koa tests.\n\n\u003ckbd\u003e✅ [View 326 tests](/doc/TESTS.md)\u003c/kbd\u003e\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\n  \u003cimg src=\"/.documentary/section-breaks/3.svg?sanitize=true\"\u003e\n\u003c/a\u003e\u003c/p\u003e\n\n## Copyright \u0026 License\n\nGNU Affero General Public License v3.0\n\nOriginal work on the [Koa Web Server](https://github.com/koajs/koa) by its authors under MIT License found in [COPYING](COPYING).\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003e\n      \u003ca href=\"https://artd.eco\"\u003e\n        \u003cimg width=\"100\" src=\"https://raw.githubusercontent.com/wrote/wrote/master/images/artdeco.png\"\n          alt=\"Art Deco\"\u003e\n      \u003c/a\u003e\n    \u003c/th\u003e\n    \u003cth\u003e© \u003ca href=\"https://artd.eco\"\u003eArt Deco\u003c/a\u003e for \u003ca href=\"https://idio.cc\"\u003eIdio\u003c/a\u003e 2019\u003c/th\u003e\n    \u003cth\u003e\n      \u003ca href=\"https://idio.cc\"\u003e\n        \u003cimg src=\"https://avatars3.githubusercontent.com/u/40834161?s=100\" width=\"100\" alt=\"Idio\"\u003e\n      \u003c/a\u003e\n    \u003c/th\u003e\n    \u003cth\u003e\n      \u003ca href=\"https://www.technation.sucks\" title=\"Tech Nation Visa\"\u003e\n        \u003cimg width=\"100\" src=\"https://raw.githubusercontent.com/idiocc/cookies/master/wiki/arch4.jpg\"\n          alt=\"Tech Nation Visa\"\u003e\n      \u003c/a\u003e\n    \u003c/th\u003e\n    \u003cth\u003e\u003ca href=\"https://www.technation.sucks\"\u003eTech Nation Visa Sucks\u003c/a\u003e\u003c/th\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003cp align=\"center\"\u003e\u003ca href=\"#table-of-contents\"\u003e\n  \u003cimg src=\"/.documentary/section-breaks/-1.svg?sanitize=true\"\u003e\n\u003c/a\u003e\u003c/p\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidiocc%2Fgoa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidiocc%2Fgoa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidiocc%2Fgoa/lists"}