1.6.1 • Published 4 years ago

@goa/goa v1.6.1

Weekly downloads
23
License
AGPL-3.0
Repository
github
Last release
4 years ago

@goa/koa

npm version

This is the source code for the @goa/koa repository that actually compiles this source code. Please navigate there for the documentation.

@goa/goa is the Koa web-sever 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 testing framework which is twice as fast and weighs 500KB against 50MB compared with Jest (as used to be used in the original repository).

yarn add @goa/goa

Table Of Contents

Goa

Goa is the same application as Koa. It has the same interface for the app object, as well as context, request and response API.

import Goa from '@goa/goa'

const app = new Goa()
app.use((ctx) => {
  ctx.body = 'hello world'
})
hello world

Types

The types detailed information can be found 📙 in Wiki. The Koa documentation can be found on its page.

Packages

Koa 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.

DependencyType
cache-content-typemodule
content-dispositionmodule
delegatesmodule
ee-firstmodule
error-injectmodule
escape-htmlmodule
freshmodule
http-assertmodule
koa-is-jsonmodule
on-finishedmodule
onlymodule
parseurlmodule

The external modules were created with tests also written to ensure their source and compiled versions work as expected.

DependencyDepDescription
@goa/acceptsdevHigher-Level Content Negotiation.
@goa/content-typedevCreate and parse HTTP Content-Type header according to RFC 7231.
@goa/cookiesdevSigned And Unsigned Cookies Based On Keygrip.
@goa/is-generator-functiondevChecks If The Function Is An ES6 Generator.
@goa/mime-typesdevThe Ultimate Javascript Content-Type Utility.
@goa/negotiatordevHTTP Content Negotiation.
@goa/type-isdevInfer The Content-Type Of A Request.
@goa/varydevManipulate The HTTP Vary header.
@goa/composedevCompose a single middleware function for Goa out of many.
@goa/http-errorsdevCreates HTTP Errors For Goa Apps.
@goa/statusesdevHTTP status utility..
@idio/debugdevLog Debugging Information.
mime-dbprodRequired for @goa/mime-types, @goa/accepts and @goa/type-is.

Tests

The tests were updated for context testing and include all original Koa tests.

✅ View 326 tests

Copyright & License

GNU Affero General Public License v3.0

Original work on the Koa Web Server by its authors under MIT License found in COPYING.

1.6.1

4 years ago

1.6.0

4 years ago

1.5.2

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.3

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.7

4 years ago

1.3.6

4 years ago

1.3.5

5 years ago

1.3.4

5 years ago

1.3.3

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago