Skip to content

@koa/router vs koa-router confusion #109

@linde12

Description

@linde12

Hi.

I'm trying out Koa and i wanted to get started with a simple crud app with a couple of routes but quickly ran into problems. There is a package on npm, @koa/router, which is under koajs/router here on Github, but there is also a package called koa-router with 4.7k stars on github which looks to be the same thing. However when installing types with npm i @types/koa-router the declarations only work if i use koa-router and not @koa/router

So the question is: which package is the "official" one, and does it also have typescript definitions (& if so how do i use/install them)? This is very confusing and unfortunately also very off-putting to someone new to the ecosystem, so i'm curious to why or if im doing something very wrong.

Expected Behavior:

@types/koa-router to work for @koa/router

Actual Behavior:

@types/koa-router works for the (3rd party?) package koa-router

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions