Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@koa/router vs koa-router confusion #109

Closed
linde12 opened this issue Oct 6, 2020 · 2 comments
Closed

@koa/router vs koa-router confusion #109

linde12 opened this issue Oct 6, 2020 · 2 comments

Comments

@linde12
Copy link

linde12 commented Oct 6, 2020

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

@dominicegginton
Copy link
Contributor

Hi @linde12

This module is forked from the original koa-router due to its lack of activity, and this repository is now the official version. Install with npm i @koa/router. I would be nice to have all the official Koa modules be published to the npm registry under the Koa scope as this would make it easier for newcomers like yourself.

To address your typescript issues try @tpes/koa__router. I believe this package contains the type definitions you are looking for. Haven't used typescript myself so haven't tried it myself sorry.

Hope this helps 😄

@linde12
Copy link
Author

linde12 commented Oct 7, 2020

Hi @linde12

This module is forked from the original koa-router due to its lack of activity, and this repository is now the official version. Install with npm i @koa/router. I would be nice to have all the official Koa modules be published to the npm registry under the Koa scope as this would make it easier for newcomers like yourself.

To address your typescript issues try @tpes/koa__router. I believe this package contains the type definitions you are looking for. Haven't used typescript myself so haven't tried it myself sorry.

Hope this helps 😄

Ah, i see! I will try the @types/koa__router package. Closing the issue, thank you!

@linde12 linde12 closed this as completed Oct 7, 2020
wallzero added a commit to wallzero/router that referenced this issue Nov 17, 2021
[Saves folks time from having to dig through old issues](koajs#109)
niftylettuce pushed a commit that referenced this issue Dec 1, 2021
[Saves folks time from having to dig through old issues](#109)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants