{"id":44605393,"url":"https://github.com/unliar/qcloudsms","last_synced_at":"2026-02-14T10:35:41.539Z","repository":{"id":65479884,"uuid":"108069355","full_name":"unliar/qcloudsms","owner":"unliar","description":"a qcloudsms sdk  with es6 class and promise. 使用promise封装的腾讯云短信sdk。","archived":false,"fork":false,"pushed_at":"2020-02-24T01:14:26.000Z","size":177,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-24T22:10:32.232Z","etag":null,"topics":["qcloud-sdk","qcloudsms"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unliar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-24T02:55:57.000Z","updated_at":"2025-02-27T03:36:07.000Z","dependencies_parsed_at":"2023-01-25T08:35:13.664Z","dependency_job_id":null,"html_url":"https://github.com/unliar/qcloudsms","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/unliar/qcloudsms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unliar%2Fqcloudsms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unliar%2Fqcloudsms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unliar%2Fqcloudsms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unliar%2Fqcloudsms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unliar","download_url":"https://codeload.github.com/unliar/qcloudsms/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unliar%2Fqcloudsms/sbom","scorecard":{"id":910655,"data":{"date":"2025-08-11","repo":{"name":"github.com/unliar/qcloudsms","commit":"29273395e2ff245343d81dc41c84995fca358501"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/24 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-24T19:00:31.004Z","repository_id":65479884,"created_at":"2025-08-24T19:00:31.004Z","updated_at":"2025-08-24T19:00:31.004Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29442780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T10:17:46.583Z","status":"ssl_error","status_checked_at":"2026-02-14T10:17:22.534Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["qcloud-sdk","qcloudsms"],"created_at":"2026-02-14T10:35:40.782Z","updated_at":"2026-02-14T10:35:41.534Z","avatar_url":"https://github.com/unliar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# qcloudsms\na qcloudsms sdk  with es6 class and promise\n一个参考腾讯云官方规则封装的更加优雅的短信发送sdk,[官方Demo](https://github.com/qcloudsms/qcloudsms/tree/master/demo/js)\n\n\n## start 开始使用\n\n\u003e before you start to use this package,you should get this appid and appkey from [TencentCloud](https://cloud.tencent.com/product/sms) ,dont use the phoneNumbers in demos,its just to show you how to run it.\n\n\u003e在使用之前,请先去申请[腾讯云短信应用](https://cloud.tencent.com/product/sms),以便获取必要的appid和appkey,并且需要申请相关的短信签名，短信模板,否则,你将会得到各种错误码返回值。[错误码](https://cloud.tencent.com/document/product/382/3771)\n\n[实例 Demo](https://github.com/unliar/qcloudsms/blob/master/demo.js)\n```\n1、install 安装\n\nnpm install qcloudsms --save\n\n2、require 导入\n\nconst Qsms=require(\"qcloudsms\")\n\n3、init 初始化\n\nconst qsms=new Qsms(\"appid\",'appkey')\n\n4、send SMS 调用接口发送短信\n\n5、check result 接收返回结果\n```\n## return 返回值 \n\u003e 类型：[Promise](http://es6.ruanyifeng.com/#docs/promise)\n```\n\n// demo中的res.data值示例\n// 错误码列表 https://cloud.tencent.com/document/product/382/3771\n\n// 单发返回值\n{\n  result: 0, // 成功字段值为0,失败则会显示错误状态码。\n  errmsg: 'OK', //成功字段值为\"OK\",失败则会显示错误原因\n  ext: '',\n  callid: '...' \n}\n\n// 群发返回值\n{\n  result: 0,\n  errmsg: 'OK',\n  ext: '',\n  detail: [{\n      result: 0,\n      errmsg: 'OK',\n      mobile: '177883232323',\n      nationcode: '86',\n      sid: '8:Kdasdasddasdasd20171028',\n      fee: 1\n    },\n    {\n      result: 0,\n      errmsg: 'OK',\n      mobile: '17603073232',\n      nationcode: '86',\n      sid: '8:Lfdasdasds20171028',\n      fee: 1\n    }\n  ]\n}\n```\n\n\n\n## methods\n```\n//demo public import\n\nconst Qsms=require(\"qcloudsms\")\n\nconst qsms=new Qsms(idnumber,'key')\n```\n1. singeSend({\n      phoneNumber,\n      msg,\n      msgType = 0,\n      nationCode = \"86\",\n      extend = \"\",\n      ext = \"\"\n    }) \n\n```\n  /**\n   * 单发短信\n   * @param {string} phoneNumber 手机号 \n   * @param {string} msg 短信正文，如果需要带签名，签名请使用【】标注\n   * @param {number} msgType 短信类型，0 普通短信，1 营销短信。默认值:0\n   * @param {string} nationCode 国家码,默认值:\"86\"\n   * @param {string} extend 扩展字段，默认值:\"\"\n   * @param {string} ext 此字段腾讯云后台服务器会按原样在应答中,默认值:\"\"\n   */\n   \n//demo\n\n qsms.singleSend({\n    phoneNumber,\n    msg,\n    msgType = 0,\n    nationCode = \"86\",\n    extend = \"\",\n    ext = \"\"\n  }).then(res=\u003e{\n    console.log(res.data)\n    if(res.data.result===0){\n      // do success\n    }else{\n      //errors\n      //find your error code in this list\n      //https://cloud.tencent.com/document/product/382/3771\n    }\n  })\n\n```\n\n2. singleSendWithParams({\n      phoneNumber,\n      tpl_id,\n      params,\n      sign,\n      nationCode = \"86\",\n      ext = \"\",\n      extend = \"\"\n    })\n  ```\n  /**\n    * 模板单发短信\n    * @param {string} phoneNumber 手机号\n    * @param {number} tpl_id 短信模板id， 详情：https://console.qcloud.com/sms/smsContent \n    * @param {array} params 模板参数数组,元素个数请不要超过模板参数个数\n    * @param {string} sign 短信签名\n    * @param {string} nationCode 国家码,默认值:\"86\"\n    * @param {string} extend 扩展字段，默认值:\"\"\n    * @param {string} ext 此字段腾讯云后台服务器会按原样在应答中,默认值:\"\"\n  */\n\n  //demo\n\n    qsms.singleSendWithParam({\n        phoneNumber: 176030703,\n        params: [12345],\n        tpl_id: 4266,\n        sign: '签名'\n      }).then(res =\u003e {\n            console.log(res.data)\n            if(res.data.result===0){\n              //  do success\n            }else{\n              //errors\n              //find your error code in this list\n              //https://cloud.tencent.com/document/product/382/3771\n            }\n        })  \n  ```\n  3. multiSend({\n        phoneNumbers,\n        msg,\n        msgType = 0,\n        nationCode = \"86\",\n        extend = \"\",\n        ext = \"\"\n     })\n  ```\n  /*\n  * 群发短信【仅国内,一次不超过200】\n  * @param {array} phoneNumbers 群发手机号数组 \n  * @param {string} msg 短信正文，如果需要带签名，签名请使用【】标注\n  * @param {number} msgType 短信类型，0 普通短信，1 营销短信。 默认值:0\n  * @param {string} nationCode 国家码,默认值:\"86\"\n  * @param {string} extend 扩展字段，默认值:\"\"\n  * @param {string} ext 此字段腾讯云后台服务器会按原样在应答中,默认值:\"\"\n  */\n\n  //demo\n  qsms.multiSend({\n      phoneNumbers: [17603070288, 17788770699],\n      msg: \"您的验证码6789，此验证码10分钟内有效，请勿向他人泄露\"\n    }).then(res =\u003e{\n      console.log(res.data)\n      if(res.data.result===0){\n        //do success\n      }else{\n        //errors\n        //find your error code in this list\n        //https://cloud.tencent.com/document/product/382/3771\n      }\n    })\n\n  ```\n  4. multiSendWithParams({\n      phoneNumbers,\n      tpl_id,\n      params,\n      sign,\n      nationCode = \"86\",\n      ext = \"\",\n      extend = \"\"\n    }) \n\n  ```\n  /**\n    * 模板群发短信【仅国内,一次不超过200】\n    * @param {array} phoneNumbers 群发手机号数组 \n    * @param {number} tpl_id 短信模板id， 详情：https://console.qcloud.com/sms/smsContent \n    * @param {array} params 模板参数数组,元素个数请不要超过模板参数个数\n    * @param {string} sign 短信签名\n    * @param {string} nationCode 国家码,默认值:\"86\"\n    * @param {string} extend 扩展字段，默认值:\"\"\n    * @param {string} ext 此字段腾讯云后台服务器会按原样在应答中,默认值:\"\"\n  */\n  \n  //demo\n  qsms.multiSendWithParams({\n      phoneNumbers: [17603070288, 17788770668],\n      params: [4523],\n      tpl_id: 423866,\n      sign: '哈哈'\n    }).then(res =\u003e{\n        console.log(res.data)\n        if(res.data.result===0){\n          //do success\n          //\n        }else{\n          //errors\n          //find your error code in this list\n          //https://cloud.tencent.com/document/product/382/3771\n        }\n    })\n\n  ```\n  \n  5. sendVoice({\n        phoneNumber,\n        msg,\n        playtimes = 2,\n        nationCode = \"86\",\n        ext = \"\"\n      })\n  ```\n  /* 语音验证码\n  * @param {string} nationCode 国家码,默认值:\"86\"\n  * @param {string} ext 此字段腾讯云后台服务器会按原样在应答中,默认值:\"\"\n  * @param {number} playtimes 重播次数，默认2，最大3。\n  * @param {number} phoneNumber 手机号码\n  * @param {number|string} msg 验证码，支持英文字母、数字及组合。\n  */\n  qsms.sendVoice({\n      phoneNumber: 17603070437,\n      msg: \"876123\"\n    }).then(res =\u003e {\n      if(res.data.result===0){\n          //do success\n          //\n        }else{\n          //errors\n          //find your error code in this list\n          //https://cloud.tencent.com/document/product/382/3771\n      }\n    })\n  ```\n  \n  6. sendVoicePrompt({\n        phoneNumber,\n        promptfile,\n        prompttype = 2,\n        nationCode = \"86\",\n        playtimes = 2,\n        ext = \"\"\n      })\n\n  ```\n  /*发送语音通知\n  * @param {number} phoneNumber 手机号码\n  * @param {string} promptfile 通知内容，utf8编码，支持中文英文、数字及组合，需要和语音* 内容模版相匹配\n  * @param {number} prompttype 语音类型,目前固定为2\n  * @param {number} playtimes 重播次数，默认2，最大3。\n  * @param {string} nationCode 国家码,默认值:\"86\"\n  * @param {string} ext 此字段腾讯云后台服务器会按原样在应答中,默认值:\"\"\n  */\n  qsms.sendVoicePrompt({\n        phoneNumber: 17603070235,\n        promptfile: \"您好雷锋，您的参会申请已经审核通过，请于11点按时参加会议，期待您的到来。\"\n      }).then(res =\u003e {\n        if(res.data.result===0){\n          //do success\n          //\n        }else{\n          //errors\n          //find your error code in this list\n          //https://cloud.tencent.com/document/product/382/3771\n        }\n      })\n  ```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funliar%2Fqcloudsms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funliar%2Fqcloudsms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funliar%2Fqcloudsms/lists"}