co-baidu-push

a wrapper of baidu-push for co or koa

npm install co-baidu-push
6 downloads in the last week
12 downloads in the last month

NPM

co-baidu-push

a wrapper for baidu-push for co or koa

install

npm install co-baidu-push

doc

example

var co     =require('co')
var Push   = require('../index')
var userId = 'a userId'

var pushOption = {
    apiKey: 'your api key',
    secretKey: 'your secret key'
}

var client = Push.createClient(pushOption)
co(function* () {
    var option = {
        user_id: userId
    }

    var result = yield client.queryBindList(option)
    // ......
})()
co(function* () {
    var option = {
        push_type: 1,
        user_id: userId,
        messages: ["hello"],
        msg_keys: ["title"]
    }
    var result = yield client.pushMsg(option)
    // ......
})()
npm loves you