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

qzx-server

v2.0.15

Published

> NEST.JS 整体感觉还是太重,而且集成太深,不是很灵活,koa 最原始,也最灵活,但是没有较好的注解支持。 此库就是对 koa 做了一层简易的安装,支持基本的注解,其余使用均与 koa 无差别。

Downloads

16

Readme

轻量的基于 KOA 的后端框架

NEST.JS 整体感觉还是太重,而且集成太深,不是很灵活,koa 最原始,也最灵活,但是没有较好的注解支持。 此库就是对 koa 做了一层简易的安装,支持基本的注解,其余使用均与 koa 无差别。

使用

新建服务

import Server from 'qzx-server';
const server = new Server({
    host: '0.0.0.0',
    port: 9999,
    plugins: [],
    controllers: [],
});
server.start();

新建 Controller

import { Controller, Post, Get } from 'qzx-server';
@Controller('/a')
export class CTest {
    @Post('/b')
    t1() {
        return 1234;
    }

    @Get('/c')
    t2() {
        return 2345;
    }
}

依赖注入

同样的,我们也支持依赖注入的操作.

import {Injectable,Ioc, Controller, Post, Get} from 'qzx-server';
@Injectable()
export class InjectTest {
  count =1;
}

@Injectable()
export class InjectTest1 {
  constructor(private test: InjectTest) {
    console.log(this.test.count);
  }
}
@Controller('/a')
export class CTest {
  	constructor(private test: InjectTest) {}
    @Post('/b')
    t1() {
	      console.log(this.test);
        return 1234;
    }
}
const test = Ioc(InjectTest)