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 🙏

© 2026 – Pkg Stats / Ryan Hefner

rop_client

v0.1.14

Published

rop的nodejs客户端

Readme

#rop_client rop框架的nodejs客户端,可以快速联接rop相关的服务端

##intall

npm install rop_client

建议使用 npm.taobao.org 源来安装,详见 npm.taobao.org

使用rop_client

首先引用rop_client:

let {RichServiceRequest,UploadFile,RopUtils,ShaUtils} =require("rop_client");

###RichServiceRequest 1.RichServiceRequest构建一个请求类(例子):

let {RichServiceRequest} = require("rop_client");
export default class extends RichServiceRequest{
    constructor() { //构造函数
        super();
        this.v="1.0";
        this.method="ping";
    }
}

2.生成ropUtils(需有services_url地址,app_key,app_secret)

let ropUtils=new RopUtils(clientInfo.services_url,clientInfo.app_key,clientInfo.app_secret);

3.然后请求服务:

const duAsync = async() => {
    let pingRequest=new PingRequest();
    let response=await ropUtils.doPostByObj(pingRequest);
    console.log(response);//返回{sucess:true}...
};
duAsync();

4.有参数上传参考:

export default class extends RichserviceRequest{
    constructor(applyNo) { //构造函数
        super(applyNo);
        this.v="1.0";
        this.method="sign.link.file";
        //以下为其它属性
        this.applyNo=applyNo;
    }
    /**验证方法,如果类中写入此方法则会先运行validate()有错执出Error*/
    validate(){
        this.applyNo=this.trim(this.applyNo);
        if(this.applyNo==''){
            throw new Error("applyNo is null");
        }
        return super.validate();
    }
}

5.对于有文件上传的情况,继承RichServiceRequest,并设置属行file,file后面传入值

let uploadFile=new UploadFile();
request.file=await uploadFile.init("/tmp/test.pdf");
let response=await ropUtils.doPostByObj(pingRequest);

6.RichserviceRequest特殊方法:

//validate 方法,验证方法,请求服务前会校验此方法
//getIgnoreSign 返回字符串数组,上传时运行此方法,这个方法返回的字段不会加入签名(一般文件字段不做签名)
//trim 处理字段为空的处理,转null空为http请求接收能为空的''