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

pdd-node-sdk

v0.0.11

Published

pinduoduo open platform node sdk

Downloads

62

Readme

拼多多开放平台Node版SDK

拼多多开放平台链接地址:https://open.pinduoduo.com/#/apidocument

pdd-node-sdk职在辅助快速开发,除了方便使用,sdk还提供了的拼多多开放平台的类型声名,存放于src/pddApi/目录当中,如果你在使用中发布类型声明文件与官方文档不一致,可以执行npm run generate重新生成声明文件。

安装及使用

# install
npm install pdd-node-sdk --save # or:yarn add pdd-node-sdk

在代码中,导入PddClient实例始可使用:

import {
  PddClient,
} from 'pdd-node-sdk';

// 根据开放平台信息,填写以下内容
const client = new PddClient({
  clientId: 'clientId',
  clientSecret: 'clientSecret',
});

调用获取商品类目属性示例

import {
  // ...
  PDD_GOODS_CAT_TEMPLATE_GET,
} from 'pdd-node-sdk';

async function getGoodsTemplate(catId, assessToken) {
  const detail = await client.execute(
    PDD_GOODS_CAT_TEMPLATE_GET,
    {
      access_token: '',
      cat_id: '',
    }
  );

  // ...
  return detail;
}

关于打印日志

pdd-node-sdk是依赖于debug包打印日志,所以你可以在启动时,在环境变量中添加:

set DEBUG=pdd:log && ...

具体关于debug的使用,可以参见debug文档。

待完善:

  • 添加完善的单元测试
  • 添加API调用文件锁