3.0.2 • Published 9 years ago

node-coolq v3.0.2

Weekly downloads
4
License
WTFPL
Repository
github
Last release
9 years ago

coolQ for Nodejs SDK


coolQ 的 基于socketApi 的 Nodejs SDK

:simple_smile: 建议使用ES6/ES7的语法

:star: 中间件!!

新版本去除了全部的组件,只保留了最基础的核心。希望大家利用中间件的特性来写出更多的中间件
新开

Intro

(:зゝ∠) 详见wiki
QQ 讨论组 304876598

Installation

  • 请安装 org.dazzyd.cqsocketapi.cpk(本人fork 修改过的)
  • 在酷Q中开启插件
  • 重启酷Q
  • 安装本模块

    npm install node-coolq --save

hello node-coolq

    const cq = require('node-coolq')
    const app = new cq()
    
    //中间件
    app.use(async (ctx, next) => {
        await ctx.app.send('PrivateMessage 296409654 ' + new Buffer("hello world").toString('base64'))
        await next()
    })
    
    app.listen().then(_ => {})

Getting started

没有快滚!

Middleware

和一些webServer框架一样这个库有中间件,但是这个中间件必须使用Promise否则讲无法运行qwq
例如:

// echo app
app.use(async (ctx, next) => {
    // 将收到的信息组合起来再发送回去
    await ctx.app.send(ctx.content.join(' '))
    await next()
})

app.listen({}).then(_ => {})

Community

License

License -> WTFPL

for haozi23333

3.0.2

9 years ago

3.2.0

9 years ago

3.1.0

9 years ago

3.0.1

9 years ago

3.0.0

9 years ago

2.1.0

10 years ago

2.0.0

10 years ago

1.0.0

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago