@666666/messagejs
v1.3.1
Published
A message sending util
Downloads
29
Readme
Messagejs
A message sending util
Support List
Install
npm install messagejs
Usage
BARK
import { Bark } from '@666666/messagejs'
const bark = new Bark({
serverUrl: 'http://foo.com',
defaultPushOption: {
deviceKey: 'foo,bar',
sound: 'bloom.caf'
}
})
// push
bark.push({
deviceKey: 'bar',
title: 'bar',
body: 'ahhhhhhhhh'
})
ServerChan
import { ServerChan } from '@666666/messagejs'
const serverchan = new ServerChan({
sendKey: 'xxxx',
encodeOptions: { // option
uid: 123,
key: 'xxx'
}
})
serverchan.send({
title: 'xxx',
desp: 'xxx',
openid: 'axxx,bxxx,cxxx',
encoded: true, // option
channel: '9|66'
})
alisms(前阿里大于)
import { Alisms } from '@666666/messagejs'
const alisms = new Alisms({
accessKeyId: 'xxx',
accessKeySecret: 'xxx'
})
alisms.sendSms({
phoneNumbers: '13xxxxxxx',
signName: '测试',
templateCode: 'xxxx',
templateParam: '{a: 123, b: 456}'
})