Expressive middleware for node.js using ES2017 async functions

Related tags

Web Frameworks koa
Overview

Koa middleware framework for nodejs

gitter NPM version build status Test coverage OpenCollective Backers OpenCollective Sponsors PR's Welcome

Expressive HTTP middleware framework for node.js to make web applications and APIs more enjoyable to write. Koa's middleware stack flows in a stack-like manner, allowing you to perform actions downstream then filter and manipulate the response upstream.

Only methods that are common to nearly all HTTP servers are integrated directly into Koa's small ~570 SLOC codebase. This includes things like content negotiation, normalization of node inconsistencies, redirection, and a few others.

Koa is not bundled with any middleware.

Installation

Koa requires node v7.6.0 or higher for ES2015 and async function support.

$ npm install koa

Hello Koa

const Koa = require('koa');
const app = new Koa();

// response
app.use(ctx => {
  ctx.body = 'Hello Koa';
});

app.listen(3000);

Getting started

  • Kick-Off-Koa - An intro to Koa via a set of self-guided workshops.
  • Workshop - A workshop to learn the basics of Koa, Express' spiritual successor.
  • Introduction Screencast - An introduction to installing and getting started with Koa

Middleware

Koa is a middleware framework that can take two different kinds of functions as middleware:

  • async function
  • common function

Here is an example of logger middleware with each of the different functions:

async functions (node v7.6+)

app.use(async (ctx, next) => {
  const start = Date.now();
  await next();
  const ms = Date.now() - start;
  console.log(`${ctx.method} ${ctx.url} - ${ms}ms`);
});

Common function

// Middleware normally takes two parameters (ctx, next), ctx is the context for one request,
// next is a function that is invoked to execute the downstream middleware. It returns a Promise with a then function for running code after completion.

app.use((ctx, next) => {
  const start = Date.now();
  return next().then(() => {
    const ms = Date.now() - start;
    console.log(`${ctx.method} ${ctx.url} - ${ms}ms`);
  });
});

Koa v1.x Middleware Signature

The middleware signature changed between v1.x and v2.x. The older signature is deprecated.

Old signature middleware support will be removed in v3

Please see the Migration Guide for more information on upgrading from v1.x and using v1.x middleware with v2.x.

Context, Request and Response

Each middleware receives a Koa Context object that encapsulates an incoming http message and the corresponding response to that message. ctx is often used as the parameter name for the context object.

app.use(async (ctx, next) => { await next(); });

Koa provides a Request object as the request property of the Context.
Koa's Request object provides helpful methods for working with http requests which delegate to an IncomingMessage from the node http module.

Here is an example of checking that a requesting client supports xml.

app.use(async (ctx, next) => {
  ctx.assert(ctx.request.accepts('xml'), 406);
  // equivalent to:
  // if (!ctx.request.accepts('xml')) ctx.throw(406);
  await next();
});

Koa provides a Response object as the response property of the Context.
Koa's Response object provides helpful methods for working with http responses which delegate to a ServerResponse .

Koa's pattern of delegating to Node's request and response objects rather than extending them provides a cleaner interface and reduces conflicts between different middleware and with Node itself as well as providing better support for stream handling. The IncomingMessage can still be directly accessed as the req property on the Context and ServerResponse can be directly accessed as the res property on the Context.

Here is an example using Koa's Response object to stream a file as the response body.

app.use(async (ctx, next) => {
  await next();
  ctx.response.type = 'xml';
  ctx.response.body = fs.createReadStream('really_large.xml');
});

The Context object also provides shortcuts for methods on its request and response. In the prior examples, ctx.type can be used instead of ctx.response.type and ctx.accepts can be used instead of ctx.request.accepts.

For more information on Request, Response and Context, see the Request API Reference, Response API Reference and Context API Reference.

Koa Application

The object created when executing new Koa() is known as the Koa application object.

The application object is Koa's interface with node's http server and handles the registration of middleware, dispatching to the middleware from http, default error handling, as well as configuration of the context, request and response objects.

Learn more about the application object in the Application API Reference.

Documentation

Troubleshooting

Check the Troubleshooting Guide or Debugging Koa in the general Koa guide.

Running tests

$ npm test

Reporting vulnerabilities

To report a security vulnerability, please do not open an issue, as this notifies attackers of the vulnerability. Instead, please email dead_horse, jonathanong, and niftylettuce to disclose.

Authors

See AUTHORS.

Community

Job Board

Looking for a career upgrade?

Backers

Support us with a monthly donation and help us continue our activities.

Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site.

License

MIT

Comments
  • Koa 2.0.0

    Koa 2.0.0

    Roadmap

    We do not plan to release v2 as "stable" until async/await hits node.js. Requiring babel to run your server is just not good developer experience. I do this right now, and I run into a host of problems. Writing your middleware with just promises or with co() or Bluebird.coroutine() everywhere isn't a good experience either. The current way to write middleware is ideal until async/await is native.

    You can track v8's progress on async functions here: https://bugs.chromium.org/p/v8/issues/detail?id=4483. After v8 implements async functions, it will take some time for that v8 version to hit stable (6 weeks i think, not sure), then more time for that v8 version to hit node stable (i believe they plan to release a major version every 6 months).

    Thus, once async functions hit v8, we have between 2-7 months to release Koa v2 as stable, but it'll probably just take us a day since not much other than the middeware signature has changed.

    Don't be scared to use Koa v2 Alpha right now, though. People are already using it in production, and we don't foresee any major changes until we mark it stable.

    Changes

    The new middleware signature is:

    // uses async arrow functions
    app.use(async (ctx, next) => {
      try {
        await next() // next is now a function
      } catch (err) {
        ctx.body = { message: err.message }
        ctx.status = err.status || 500
      }
    })
    
    app.use(async ctx => {
      const user = await User.getById(this.session.userid) // await instead of yield
      ctx.body = user // ctx instead of this
    })
    

    You don't have to use asynchronous functions - you just have to pass a function that returns a promise. A regular function that returns a promise works too!

    We don't know how much performance difference there will be, nor do many of the maintainers really care. Koa is as minimal as a framework can be and will not be your app's bottleneck.

    New Features

    Hopefully, Koa v2 will not have any new features as new features can be added to v1 as well. The only new features that will be added to Koa v2 will be breaking changes. Some possible features are:

    • https://github.com/koajs/koa/issues/469
    • https://github.com/koajs/koa/issues/281

    Features for HTTP2 support can still go into Koa v1. The only problem is that if it's not in require('http') or require('https'), we're not going to include it in Koa. node-spdy is probably going to be the code that is merged into node.js.

    Middleware

    All of the current stable versions of middleware should be targeting koa v1. If it doesn't, let us know and we'll fix it.

    Middleware may have an "alpha" version of the koa v2 version. These should NOT be marked as stable. If they do not exist, let us know and we'll create an alpha version so you can try it with koa v2. Better yet, make a PR!

    Upgrading Middleware

    You will have to convert your generators to async functions with the new middleware signature:

    app.use(async ctx => {
      const user = await Users.getById(this.session.user_id)
      ctx.body = { message: 'some message' }
    })
    

    Upgrading your middleware may be a pain in the ass. One migration path is to update them one-by-one.

    1. Wrap all your current middleware in koa-convert
    2. Test
    3. npm outdated to see which koa middleware is outdated
    4. Update one outdated middleware, remove using koa-convert
    5. Test
    6. Repeat steps 3-5 until you're done

    We have plans to create a migration bot #625 to make this process slightly better.

    Updating Your Code

    You should start refactoring your code now to ease migrating to Koa v2:

    • Return promises everywhere!
    • Do not use yield*
    • Do not use yield {} or yield [].
      • Convert yield [] into yield Promise.all([])
      • Convert yield {} into yield Bluebird.props({})

    You could also refactor your logic outside of Koa middleware functions. Create functions like function* someLogic(ctx) {} and call it in your middleware as const result = yield someLogic(this). Not using this will help migrations to the new middleware signature, which does not use this.

    I currently use babel and use async functions + flow type outside of koa middleware. this will make my migration path in the future easier. I'm not sure if I plan to ever remove babel though since I really like flow type.

    How You Can Help

    • Documentation - we need a lot!
    • Testing Koa v2 and its corresponding middleware
    • Help create the migration bot https://github.com/koajs/koa/issues/625

    Questions

    • Should we transpile w/ babel before we publish? It might make performance better as it transpiles down to ES5, which V8 is more optimized with. Anyone wanna try benchmarking it?
    documentation 
    opened by jonathanong 341
  • es7 async function feedback

    es7 async function feedback

    es7 async functions are now supported when you enabled app.experimental = true. it uses https://github.com/thenables/composition. however, the last time i benchmarked it, it was significantly slower.

    please provide feedback and maybe do some benchmarks and performance improvements so we can one day support es7 async functions by default without sacrificing anything :)

    help wanted 
    opened by jonathanong 97
  • Switch to a new testing system

    Switch to a new testing system

    Frameworks

    | Framework | Simultaneous Testing | Multiple Processes For Multiple Files | Global Error Handling | Builtin Babel | NPM Downloads/Month | | --- | :-: | :-: | :-: | :-: | :-: | | Mocha (current) | | | ✓ | | NPM Downloads/Month | | Ava | ✓ | ✓ | | ✓ | NPM Downloads/Month | | Jest | ✓ | ✓ | | ✓ | NPM Downloads/Month |

    Request Libraries

    | Request Library | Uses Promises | Builtin Response Testing | Response Testing Covers Common Use Cases | Reasonable Defaults For Testing | NPM Downloads/Month | | --- | :-: | :-: | :-: | :-: | :-: | | Superagent | | | | ✓ | NPM Downloads/Month | | Supertest (current) | | ✓ | | ✓ | NPM Downloads/Month | | Supertest-As-Promised | ✓ | ✓ | | ✓ | NPM Downloads/Month | | Assert-Request | ✓ | ✓ | ✓ | ✓ | NPM Downloads/Month | | Request | | | | ✓ | NPM Downloads/Month | | Request-Promise | ✓ | | | | NPM Downloads/Month | | Node-Fetch | ✓ | | | ✓ | NPM Downloads/Month | | Requisition | ✓ | | | ✓ | NPM Downloads/Month |

    Notes

    • (current) indicates that Koa currently uses it.
    • If we use a framework with builtin babel support, we can easily use async/await in place of builtin response testing if the library supports promises.
    • If a request library doesn't have reasonable defaults, we can easily create a wrapper that does.
    • If the response testing doesn't cover common use cases, a custom helper assertion function can be used instead.

    If anybody has any more columns or rows to add to either table, please leave a comment.

    enhancement tests help wanted version-minor 
    opened by PlasmaPower 57
  • ES6 refactor

    ES6 refactor

    Would Koa be interested in an ES6 refactor via PR? Since we're using Babel, I could do it bit-by-bit. Just to name a few benefits- Readability via const, import/export instead of require, => functions, enhanced object literals, destructuring for things like const { req } = this...

    // cc @jonathanong @tj

    opened by tejasmanohar 47
  • How to send response in koa

    How to send response in koa

    I understand that when I set this.body and all middleware finished executing the response is sent.

    What I want is to send the response at some point and then execute some remaining actions.

    Simply setting this.body and then doing yield next doesn't seem to do it - it doesn't seem to automatically send the response after the current middleware. I might be wrong, please correct me if this is the case.

    This is the simplified code of what I've tried:

    var router = require('koa-router');
    router.get('/test', store, process);
    
    function *store(next) {
      yield storeToDB(this.request.body);
      this.body = 'OK';
      // it seems like I need to do something here to send response, like res.send('OK') in express
      try { yield next; }
      catch(e) { console.log('processing error:', e); }
    }
    
    function *process() {
      yield processData(this.request.body);
    }
    

    The response is sent after process, not after store as I need.

    I understand that some separate process can read from DB on some notifications or schedule, but I wanted to keep it simple yet...

    opened by epoberezkin 38
  • async (ctx, next) => await next()

    async (ctx, next) => await next()

    closes https://github.com/koajs/koa/pull/530

    please test this. if you guys wanna benchmark this, that would be helpful too!

    • [ ] update docs
    • [ ] add end-to-end testing w/ babel
    • [x] publish and set koa-compose version
    • [ ] add a warning to koa@1 about the middleware signature change
    opened by jonathanong 37
  • better stream error handling

    better stream error handling

    Some ideas how to better handle streams, the biggest problem being error handling.

    As in https://github.com/koajs/koa/issues/180#issuecomment-32126654

    // what you have to do currently
    // ugly as fuck
    app.use(function*(){
      var a = streamA().on('error', this.onerror);
      var b = streamB().on('error', this.onerror);
      this.body = a.pipe(b).pipe(streamC());
    });
    

    With multipipe.

    // with `multipipe`
    app.use(function*(){
      this.body = pipe(streamA(), streamB(), streamC());
    });
    
    // for fs leaks, also accept functions as this.body
    // and call them when no other handler is set
    // leaky as fuck
    app.use(function*(){
      this.body = fs.createReadStream.bind(null, 'file.html');
    });
    
    opened by juliangruber 36
  • Clarify documentation how to flush headers early using koa

    Clarify documentation how to flush headers early using koa

    We tried all possible google links about "koa flush headers early" and only could found two issues about "flushHeaders" function.

    We tried that function but it doesn't work as expected. The expected behavior is:

    1. call flushHeaders()
    2. all headers that were set are sent over the internet to the client
    3. if the server tries to set other headers it throws
    4. when the body is set, it's streamed to the client

    A basic use-case is to stream "preload" headers for alerting the client to download CSS and font files, so they will be ready by the time slow api and db calls are finished.

    For some reason we were able to do this with express and can't figure out how to do it with Koa. Probably just missing documentation, it will help a lot! Thanks.

    opened by mufumbo 35
  • Switch from supertest to assert-request

    Switch from supertest to assert-request

    Assert-request is a promise-based utility I created to replace supertest. Supertest often leads to a custom .end function checking things like a header not existing. In addition, .expect is messy because it tries to be a single function to assert everything. As you can see by looking through the diff, assert-request leads to much cleaner code.

    If you're worried about this getting unpublished, NPM recently changed the unpublish feature after left-pad (you first have to contact support and they will check if anything will break because it's gone). If you're worried about this not being maintained, first of all I plan to maintain this, and second of all you can always fork it. The code base is well tested, and IMO well written.

    opened by PlasmaPower 35
  • custom status

    custom status

    i think this is enough for custom status.

    var koa = require('koa');
    var app = koa();
    
    app.statuses['700'] = 'Custom Status';
    
    app.use(function* () {
      this.status = 700;
    });
    
    app.listen(3000);
    
    curl http://127.0.0.1:3000/ -i
    HTTP/1.1 700 Custom Status
    X-Powered-By: koa
    Content-Type: text/plain; charset=utf-8
    Content-Length: 13
    Date: Wed, 01 Oct 2014 12:27:11 GMT
    Connection: keep-alive
    
    Custom Status
    
    opened by dead-horse 35
  • It's time to release 1.0.0

    It's time to release 1.0.0

    Hi all, there is no bug issues report for a long time. And nodejs will enable generator by default on 4.0.0.

    So can we release the koa 1.0.0 after nodejs 4.0.0 publish?

    opened by fengmk2 31
  • build(deps): bump json5 from 2.2.1 to 2.2.3

    build(deps): bump json5 from 2.2.1 to 2.2.3

    Bumps json5 from 2.2.1 to 2.2.3.

    Release notes

    Sourced from json5's releases.

    v2.2.3

    v2.2.2

    • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295).
    Changelog

    Sourced from json5's changelog.

    v2.2.3 [code, diff]

    v2.2.2 [code, diff]

    • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295).
    Commits
    • c3a7524 2.2.3
    • 94fd06d docs: update CHANGELOG for v2.2.3
    • 3b8cebf docs(security): use GitHub security advisories
    • f0fd9e1 docs: publish a security policy
    • 6a91a05 docs(template): bug -> bug report
    • 14f8cb1 2.2.2
    • 10cc7ca docs: update CHANGELOG for v2.2.2
    • 7774c10 fix: add proto to objects and arrays
    • edde30a Readme: slight tweak to intro
    • 97286f8 Improve example in readme
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the Security Alerts page.
    dependencies 
    opened by dependabot[bot] 1
  • Initialize context.state sooner

    Initialize context.state sooner

    Fixes #1646

    Description

    Allow context creation an overridable Koa option.

    Checklist

    • [x] I have ensured my pull request is not behind the main or master branch of the original repository.
    • [x] I have rebased all commits where necessary so that reviewing this pull request can be done without having to merge it first.
    • [x] I have written a commit message that passes commitlint linting.
    • [x] I have ensured that my code changes pass linting tests.
    • [x] I have ensured that my code changes pass unit tests.
    • [x] I have described my pull request and the reasons for code changes along with context if necessary.
    opened by krisstern 1
  • build(deps-dev): bump jest from 28.1.3 to 29.3.1

    build(deps-dev): bump jest from 28.1.3 to 29.3.1

    Bumps jest from 28.1.3 to 29.3.1.

    Release notes

    Sourced from jest's releases.

    v29.3.1

    Fixes

    • [jest-config] Do not warn about preset in ProjectConfig #13583

    Performance

    • [jest-transform] Defer creation of cache directory #13420

    v29.3.0

    Features

    • [jest-runtime] Support WebAssembly (Wasm) imports in ESM modules (#13505)

    Fixes

    • [jest-config] Add config validation for projects option (#13565)
    • [jest-mock] Treat cjs modules as objects so they can be mocked (#13513)
    • [jest-worker] Throw an error instead of hanging when jest workers terminate unexpectedly (#13566)

    Chore & Maintenance

    • [@jest/transform] Update convert-source-map (#13509)
    • [docs] Mention toStrictEqual in UsingMatchers docs. (#13560)

    New Contributors

    Full Changelog: https://github.com/facebook/jest/compare/v29.2.2...v29.3.0

    v29.2.2

    Fixes

    • [@jest/test-sequencer] Make sure sharding does not produce empty groups (#13476)
    • [jest-circus] Test marked as todo are shown as todo when inside a focussed describe (#13504)
    • [jest-mock] Ensure mock resolved and rejected values are promises from correct realm (#13503)
    • [jest-snapshot] Don't highlight passing asymmetric property matchers in snapshot diff (#13480)

    Chore & Maintenance

    • [docs] Update link to Jest 28 upgrade guide in error message (#13483)
    • [jest-runner, jest-watcher] Update emittery (#13490)

    New Contributors

    ... (truncated)

    Changelog

    Sourced from jest's changelog.

    29.3.1

    Fixes

    • [jest-config] Do not warn about preset in ProjectConfig (#13583)

    Performance

    • [jest-transform] Defer creation of cache directory (#13420)

    29.3.0

    Features

    • [jest-runtime] Support WebAssembly (Wasm) imports in ESM modules (#13505)

    Fixes

    • [jest-config] Add config validation for projects option (#13565)
    • [jest-mock] Treat cjs modules as objects so they can be mocked (#13513)
    • [jest-worker] Throw an error instead of hanging when jest workers terminate unexpectedly (#13566)

    Chore & Maintenance

    • [@jest/transform] Update convert-source-map (#13509)
    • [docs] Mention toStrictEqual in UsingMatchers docs. (#13560)

    29.2.2

    Fixes

    • [@jest/test-sequencer] Make sure sharding does not produce empty groups (#13476)
    • [jest-circus] Test marked as todo are shown as todo when inside a focussed describe (#13504)
    • [jest-mock] Ensure mock resolved and rejected values are promises from correct realm (#13503)
    • [jest-snapshot] Don't highlight passing asymmetric property matchers in snapshot diff (#13480)

    Chore & Maintenance

    • [docs] Update link to Jest 28 upgrade guide in error message (#13483)
    • [jest-runner, jest-watcher] Update emittery (#13490)

    29.2.1

    Features

    • [@jest/globals, jest-mock] Add jest.Spied* utility types (#13440)

    Fixes

    • [jest-environment-node] make globalThis.performance writable for Node 19 and fake timers (#13467)

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • [feat] Prefer returning the next middleware's result in the documentation examples

    [feat] Prefer returning the next middleware's result in the documentation examples

    There are examples in the documentation that show that it is not necessary to return a result of the next middleware. If the developers follow this example for writing packages, then it will be impossible to do this things:

    app.use(async (ctx, next) => {
      const result = await next();
      if(result instanceof CustomError){
        ctx.body = "something wrong";
        ctx.status = 500;
        return;
      }
      if(!result && typeof result === "object"){
        ctx.body = result; // response with json
      }
    })
    
    app.use(async (ctx, next) => {
      // example code from external package
      await next();
      // the result is lost
    });
    
    app.use(async ctx => {
      if(ctx.request.charset !== 'utf-8') // some logic
        return new CustomError();
    
      return { ok: true }
    });
    

    Actually, I see this use case as extremely convenient. Why not allow something to be returned for processing? And, for example, consider it as the body of the response. It doesn't matter whether it is a string, an object or a stream, just treat it as a response.

    Checklist

    • [x] I have searched through GitHub issues for similar issues.
    • [x] I have completely read through the README and documentation.
    enhancement 
    opened by zkulbeda 0
  • [feat] Support trailer headers

    [feat] Support trailer headers

    Describe the feature

    Support HTTP Trailer headers that come after the response body:

    https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Trailer

    Checklist

    • [x] I have searched through GitHub issues for similar issues.
    • [x] I have completely read through the README and documentation.
    enhancement 
    opened by kuba-orlik 0
  • build(deps-dev): bump eslint-plugin-promise from 5.2.0 to 6.1.1

    build(deps-dev): bump eslint-plugin-promise from 5.2.0 to 6.1.1

    Bumps eslint-plugin-promise from 5.2.0 to 6.1.1.

    Release notes

    Sourced from eslint-plugin-promise's releases.

    v6.1.1

    6.1.1 (2022-10-19)

    Bug Fixes

    • no-multiple-resolved: false positives when the last expression in a try block is a call to resolve (#384) (dc51b1c)

    v6.1.0

    6.1.0 (2022-10-13)

    Bug Fixes

    Features

    • add no-multiple-resolved rule (#369) (3a6fdbe)
    • always-return: add ignoreLastCallback option (#365) (01def31)
    • catch-or-return,no-new-statics,no-promise-in-callback,valid-params: add support for Promise.allSettled() & Promise.any() (#370) (e080f82)
    • param-names: add resolvePattern & rejectPattern option (#368) (df25e3c)
    Changelog

    Sourced from eslint-plugin-promise's changelog.

    6.0.2

    • Added tests for @​typescript-eslint/parser support

    6.0.1

    • Fixed @​typescript-eslint/parser issue #331, #205

    6.0.0

    Commits
    • dc51b1c fix(no-multiple-resolved): false positives when the last expression in a try ...
    • 70f0012 chore: fix branch of rule docs link URL to main (#381)
    • 72cfdc8 chore: sort package.json (#385)
    • 71e53a0 fix(CI): fix release script (#380)
    • 04fa169 chore(CI): add automatic release (#379)
    • c970565 chore(CI): simplify testing strategy (#378)
    • e8eabf4 chore(deps-dev): bump @​typescript-eslint/parser from 5.39.0 to 5.40.0 (#377)
    • b2136c3 chore(deps-dev): bump eslint from 8.24.0 to 8.25.0 (#376)
    • 7cfa19e chore(deps-dev): bump @​typescript-eslint/parser from 5.38.1 to 5.39.0 (#374)
    • 8875343 chore(deps): bump styfle/cancel-workflow-action from 0.10.0 to 0.10.1 (#372)
    • Additional commits viewable in compare view
    Maintainer changes

    This version was pushed to npm by eslint-community-bot, a new releaser for eslint-plugin-promise since your current version.


    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
Owner
Koa.js
Next generation web framework for Node.js
Koa.js
A template project for building high-performance, portable, and safe serverless functions in Vercel.

Tutorial | Demo for image processing | Demo for tensorflow This is a Next.js project bootstrapped with create-next-app. This project is aimed to demon

Second State 63 Dec 8, 2022
Fast, unopinionated, minimalist web framework for node.

Fast, unopinionated, minimalist web framework for node. const express = require('express') const app = express() app.get('/', function (req, res) {

null 59.5k Jan 5, 2023
A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications on top of TypeScript & JavaScript (ES6, ES7, ES8) 🚀

A progressive Node.js framework for building efficient and scalable server-side applications. Description Nest is a framework for building efficient,

nestjs 53.2k Dec 31, 2022
Realtime MVC Framework for Node.js

Website Get Started Docs News Submit Issue Sails.js is a web framework that makes it easy to build custom, enterprise-grade Node.js apps. It is design

Balderdash 22.4k Dec 31, 2022
🥚 Born to build better enterprise frameworks and apps with Node.js & Koa

Features Built-in Process Management Plugin System Framework Customization Lots of plugins Quickstart Follow the commands listed below. $ mkdir showca

egg 18.3k Dec 29, 2022
Fast and low overhead web framework, for Node.js

An efficient server implies a lower cost of the infrastructure, a better responsiveness under load and happy users. How can you efficiently handle the

Fastify 26k Jan 2, 2023
📦🔐A lightweight private proxy registry build in Node.js

Version 6 (Development branch) Looking for Verdaccio 5? Check branch 5.x. Verdaccio is a simple, zero-config-required local private npm registry. No n

Verdaccio 14.3k Dec 31, 2022
The future of Node.js REST development

restify is a framework, utilizing connect style middleware for building REST APIs. For full details, see http://restify.com Follow restify on Usage Se

restify 10.6k Jan 2, 2023
🚀 The Node.js Framework highly focused on developer ergonomics, stability and confidence

Sponsored by FOSS United is a non-profit foundation that aims at promoting and strengthening the Free and Open Source Software (FOSS) ecosystem in Ind

AdonisJS Framework 13.4k Dec 31, 2022
Use full ES2015+ features to develop Node.js applications, Support TypeScript.

ThinkJS Use full ES2015+ features to develop Node.js applications, Support TypeScript. 简体中文文档 Installation npm install -g think-cli Create Application

ThinkJS 5.3k Dec 30, 2022
:rocket: Progressive microservices framework for Node.js

Moleculer Moleculer is a fast, modern and powerful microservices framework for Node.js. It helps you to build efficient, reliable & scalable services.

MoleculerJS 5.5k Jan 4, 2023
MVC framework making it easy to write realtime, collaborative applications that run in both Node.js and browsers

Derby The Derby MVC framework makes it easy to write realtime, collaborative applications that run in both Node.js and browsers. Derby includes a powe

DerbyJS 4.7k Dec 23, 2022
Node.js framework

Node.js framework Total.js framework is a framework for Node.js platfrom written in pure JavaScript similar to PHP's Laravel or Python's Django or ASP

Total.js 4.2k Jan 2, 2023
API Services Made Easy With Node.js

Nodal API Services Made Easy with Node.js View the website at nodaljs.com. Nodal is a web server and opinionated framework for building data manipulat

Keith Horwood 4.5k Dec 26, 2022
A microservices toolkit for Node.js.

A Node.js toolkit for Microservice architectures This open source module is sponsored and supported by Voxgig. seneca Lead Maintainer: Richard Rodger

Seneca Microservices Framework 3.9k Dec 19, 2022
🍔 A Node.js Serverless Framework for front-end/full-stack developers. Build the application for next decade. Works on AWS, Alibaba Cloud, Tencent Cloud and traditional VM/Container. Super easy integrate with React and Vue. 🌈

Midway - 一个面向未来的云端一体 Node.js 框架 English | 简体中文 ?? 欢迎观看 Midway Serverless 2.0 发布会回放: https://www.bilibili.com/video/BV17A411T7Md 《Midway Serverless 发布

Midway.js 6.3k Jan 8, 2023
:evergreen_tree: Modern Web Application Framework for Node.js.

Trails is a modern, community-driven web application framework for Node.js. It builds on the pedigree of Rails and Grails to accelerate development by

Trails 1.7k Dec 19, 2022
Marble.js - functional reactive Node.js framework for building server-side applications, based on TypeScript and RxJS.

Functional reactive Node.js framework for building server-side applications, based on TypeScript and RxJS. Ecosystem Name Description @marblejs/core F

Marble.js 2.1k Dec 16, 2022
🔬 Writing reliable & fault-tolerant microservices in Node.js

A Node.js microservices toolkit for the NATS messaging system Run on repl.it Node: v6+ Documentation: https://hemerajs.github.io/hemera/ Lead Maintain

HemeraJs 800 Dec 14, 2022