sreymom/my-lib

0.1.1 2024-04-08 09:27 UTC

This package is not auto-updated.

Last update: 2024-09-23 12:23:39 UTC


README

此库支持以下PHP实现

  • Node.js v12.22.12
  • Node.js v13.14.0
  • Node.js v14.21.3
  • Node.js v15.14.0
  • Node.js v16.20.2
  • Node.js v17.9.1
  • Node.js v18.19.1
  • Node.js v19.9.0
  • Node.js v20.11.1
  • Node.js v21.7.1

支持TypeScript版本 ^5.4.2

安装

npm install plasgateyarn add plasgate

测试安装

为了确保安装成功,您可以尝试发送一条短信给自己,如下所示

    // Your private key and secret key from plasgate.com
    const privateKey = "your_private_key"
    const secretKey = "your_x-secret_key"

    const client = require("plasgate")(privateKey, secretKey);

    client.messages
    .create({
        to: "+855977804485",
        sender: "SMS Info",
        content: "Welcome to Plasgate SMS gateway",
    }).catch((error) => console.error("Error:", error));

开始使用

如果您想熟悉该项目,可以通过创建仓库的分支并在本地开发环境中克隆它来开始。项目需要在您的机器上安装Node.js

克隆仓库后,在克隆仓库的目录中运行以下命令来安装依赖项

npm install

您可以通过执行以下命令来运行现有的测试,以查看一切是否正常

npm test