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

QAP-SDK

v2.4.8

Published

JSSDK for Qianniu Application Platform based on X-Bridge

Readme

千牛 Mobile SDK

服务于千牛、Lazada、阿里妈妈客户端应用开发的JSSDK。

版本列表

最新版本:2.4.4

更多历史版本请查看:https://www.npmjs.com/package/QAP-SDK

版本 2.x vs 1.x

  • QN.ajax 新接口。支持方便快捷地进行异步请求。
  • QN.fetch 升级。不再支持 mode: jsonpdataType 参数。 JSONP 接口请使用 QN.ajax
  • QN.mtop 升级,详见文档。
  • QN.on QN.off QN.emit 接口升级,调用更简单。新增多个系统级事件。
  • QN.sso 升级,支持 forceReAuth
  • QN.navigator 升级,支持页面降级时自动转换URL,新增 N 多系统图标。

如果你仍在使用 QAP-SDK 1.x,请参考:QAP-SDK 1.x 文档

Getting start

介绍

由于 QAP-SDK 的跨三端特性,QAP-SDK 包发布时会同时发布 NPM 包 和 CDN 版本。其中 CDN 版本的根路径为://g.alicdn.com/x-bridge/qap-sdk/{version}/

在 NPM 包 和 CDN 版本中, 都会包含 2 个文件,如下:

├── qn.min.js
└── qn.web.min.js

| 文件 | 说明 | |:----------------|:---------------------------------------------------------------------| | qn.min.js | 包默认输出的文件,同时兼容 Weex/Web 环境 | | qn.web.min.js | 专用于 Web 环境下的版本,体积比 qn.min.js 小,但接口、功能完全一样 |

以 NPM 依赖包形式使用

这种方式在 Weex/Web 中均可以

安装 Install

npm install QAP-SDK --save

QN SDK 依赖于 Promise,对于不支持的环境,还需要安装并依赖 Promise polyfill

npm install es6-promise-polyfill --save;

import QAP-SDK

在 Weex 环境中,通过以下方式 import QAP-SDK:

import QN from 'QAP-SDK';

在 Web 环境中,通过以下方式 import QAP-SDK:

import QN from 'QAP-SDK/qn.web.min';

以 script 标签形式引入使用

<script src="//g.alicdn.com/x-bridge/qap-sdk/2.4.4/qn.web.min.js"></script>

调用 SDK 接口

在 Weex/Web 环境中,QAP-SDK 接口调用的方式都完全一致。

// Promise 形式
QN.top.invoke({
    query: {
        method: 'taobao.time.get', // TOP 接口名称
    },
}).then(result => {
    console.log(result);
}, error => {
    console.log(error);
});

// 回调函数形式
QN.top.invoke({
    query: {
        method: 'taobao.time.get', // TOP 接口名称
    },
    success(result) {
        console.log(result);
    },
    error(error) {
        console.log(error);
    }
});

更多接口调用文档请参考API文档。