@666666/messagejs
TypeScript icon, indicating that this package has built-in type declarations

1.3.1 • Public • Published

Messagejs

A message sending util

example workflow

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}'
})

Todo

Readme

Keywords

Package Sidebar

Install

npm i @666666/messagejs

Weekly Downloads

5

Version

1.3.1

License

MIT

Unpacked Size

16.4 kB

Total Files

19

Last publish

Collaborators

  • 666666