npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@kosmic/koa

v0.0.8

Published

Typescript first drop in replacement for koa

Downloads

14

Readme

@kosmic/koa

A strongly typed Koa drop in replacement

@kosmic/koa is a typescript first drop in replacement for koa. There are virtually 0 differences in the js code base and tests are run against the original koa tests as well as additional tests to ensure that @kosmic/koa is 100% production ready and directly compatible with the latest version of koa. Koa is very stable and is only updated infrequently, but we use github actions to closely track any changes that may occur. In addition, it is very easy to use @kosmic/koa with any third party types as well, and no breaking changes should occur, at all, ever.

Why do this?

  • Much better, seamless, and stronger TS experience in every aspect.
  • Types designed specifically for great intellisense with ts server.
    • easily see and validate any type on any object
    • Full koa documentation and examples on every getter,setter,method, and property on any koa object!!!!! Never check the koa docs again!
  • Less packages to install and worry about when using koa with typescript.

I'm just using koa with JS - I don't need @kosmic/koa

Wait! If you use ts-server (ie, most code editors are using this), you can immediately benefit from awesome intellisense, even in pure JavaScript!! Once again, never check the docs again for you Koa questions, its right there in your editor!

How to use

Step 1

Remove both koa and @types/koa from your package.json and then install @kosmic/koa and alias it to koa.

npm install @kosmic/koa@npm:koa

or

yarn add @kosmic/koa@npm:koa or pnpm add @kosmic/koa@npm:koa

Thats it!

You will now experience Koa with all the power of typescript built in.

A note on compatibility

@kosmic/koa mimics the types in @types/koa, however, they are not compatible. Third party types can extend them both the same way. In this way, if you want to use any existing koa module with third party types, you can easily do so, but your project needs to alias @kosmic/koa as koa.

This aliasing tends to work out of the box if you are using npm as a package manager, however, yarn and pnpm may require some extra configuration. The main ideas is that your project should see and use @kosmic/koa anywhere it tries to use koa.