Detalhes do pacote

@goa/koa

idiocc1.2kAGPL-3.02.1.0

The Koa2 Fork Optimized With Closure Compiler That Has Just 1 Dependency (mime-db).

koa, goa, idio, gcc

readme (leia-me)

@goa/koa

npm version

@goa/koa 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 the old-school NPM package making, including starting to use import/export statements without Babel, restoring to pure JSDoc without TypeScript, and compiling the code into the 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 in the original repository).

@Goa/Koa Source Code Is ~2000 Lines Of Code
@Goa/Koa Compiled Source Code.
Yarn Install NPM Install
sh yarn add @goa/koa sh npm install @goa/koa

This package actually compiles the Goa Source Code. You can find all the documentation on that package's page.

Table Of Contents

API

The package is available by importing its default class:

import Goa from '@goa/koa'

constructor(
  options=: ApplicationOptions,
): Application

Creates a new app instance.

SourceOutput
js import aqt from '@rqt/aqt' import Goa from '@goa/koa' const goa = new Goa() goa.use(async (ctx, next) => { ctx.body = 'Hello World' ctx.status = 201 ctx.message = 'example' await next() }) goa.listen(3000, async function() { const url = `http://localhost:3000` console.log(url, '\n') const res = await aqt(url) console.log(res) this.close() }) js http://localhost:3000 { body: 'Hello World', headers: { 'content-type': 'text/plain; charset=utf-8', 'content-length': '11', date: 'Sat, 21 Dec 2019 05:10:34 GMT', connection: 'close' }, statusCode: 201, statusMessage: 'example' }

Copyright & License

GNU Affero General Public License v3.0

Original work on the Koa Web Server by its authors under MIT License found in Goa's Source Code repository.

Art Deco © Art Deco for Idio 2019 Idio Tech Nation Visa Tech Nation Visa Sucks

changelog (log de mudanças)

21 December 2019

2.1.0

  • [feature] Export Context constructor.
  • [feature] Accept application options.

20 December 2019

2.0.2

  • [fix] Attachment options.

19 December 2019

2.0.1

  • [docs] Organise typedefs fully.

18 December 2019

2.0.0

  • [template] Use typeof Application in the template.
  • [license] Update to AGPL-3.0.

9 December 2019

1.1.5

  • [fix] Update types, compile with less warnings.

8 December 2019

1.1.4

  • [doc] vendor Cookies and Accepts types.
  • [package] mv to compile.

3 July 2019

1.1.3

  • [deps] Update goa for external libraries (@goa/type-is, @goa/content-type) instead of included modules.

21 June 2019

1.1.2

  • [deps] Use typework for typedefs management.

20 June 2019

1.1.1

  • [fix] Fix the issue with @ in types.

12 May 2019

1.1.0

  • [deps] Install mime-db as a dependency.
  • [org] Publish @goa/goa with modules, types and tests, and compile the source code in the @goa/koa package using Depack.

11 May 2019

1.0.2

  • [package-fix] Publish depack folder instead of build.

1.0.1

  • [jsdoc-fix] Link typedefs via depack entry.

1.0.0

  • [package] Publish the v1.0.0 of the package.

4 May 2019

0.0.0