npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

alidayujs

v1.0.5

Published

JavaScript Alidayu(阿里大鱼) SDK 兼容服务器端环境node.js,模块加载器如RequireJS和所有浏览器

Downloads

54

Readme

alidayujs

npm

JavaScript Alidayu SDK 兼容服务器端环境node.js,模块加载器如RequireJS和所有浏览器

Demo

alidayujs-demo

Usage

Client-side

Web浏览器JavaScript直接调用alidayujs SDK需要两个的依赖文件:jQuery.js和md5.js,其中md5.js网上版本很多,这里使用JavaScript-MD5

1、HTML脚本标签引入文件如

<script src="http://cdn.bootcss.com/jquery/2.2.0/jquery.js"></script>
<script src="http://cdn.bootcss.com/blueimp-md5/2.1.0/js/md5.js"></script>
<script src="lib/alidayu.js"></script>

2、示例脚本代码

    //应用密匙 见:http://www.alidayu.com/help?spm=a3142.7802526.1.24.iEB4Yc&_t=1#create
    var config = {
        app_key: '23300111',
        secret: '3403636b338e1003999dd946111111' 
    };
    //创建实例
    var dayu = new AliDaYu(config);
    //参数 见:http://open.taobao.com/doc2/apiDetail.htm?apiId=25450
    var params = {
        sms_free_sign_name: '身份验证',
        sms_param: {
            code: '52031',
            product: 'alidayujs ajax post test',
        },
        rec_num: '15110111111',
        sms_template_code: 'SMS_4725038',
    };
    //短信发送
    dayu.sms(params,function(err,result){
        if(err){
            return console.log(err);
        }
        console.log(result);
    });

Server-side

以下介绍如何在 Node.js环境下使用alidayujs

1、安装

    npm install alidayujs --save
    

说明:内部需要两个模块require,blueimp-md5

2、使用方法


    var Alidayu=require('./lib/alidayu');
    //应用密匙 见:http://www.alidayu.com/help?spm=a3142.7802526.1.24.iEB4Yc&_t=1#create
    var config = {
        app_key: '23300111',
        secret: '3403636b338e1003999dd946111111' 
    };
    var alidayu = new Alidayu(config);
    //参数 见:http://open.taobao.com/doc2/apiDetail.htm?apiId=25450
    var options = {
        sms_free_sign_name: '身份验证',
        sms_param: {
        code: '1234',
        product: 'alidayujs测试',
        },
        rec_num: '15110111111', 
        sms_template_code: 'SMS_4725038',
    };
    //发送短信
    alidayu.sms(options,function(err,result){
        if(err){
            console.log('ERROR'+err);
        }
        console.log(result);
    });

License

MIT ©giscafer