Skip to content

aspxdiyer/pddclient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pddclient

npm version

Node.js版的多多客接口

安装

npm install pddclient --save

使用方法

Promise

const pddClient = require('pddclient');

const client = new pddClient({
  client_id: 'client_id',
  client_secret: 'client_secret',
});


client.execute("pdd.ddk.goods.search", {
    keyword"推荐"
    , with_coupontrue
    , page_size20
    , page1
    , sort_type1
    , list_id''
}).then(res=>{
    console.log(res);
});

Async / await

const pddClient = require('pddclient');

async function search(){
    const client = new PddClient({
                client_id'client_id',
                client_secret'client_secret'
            });
    let result;
    try{
        result = await client.execute("pdd.ddk.goods.search", {
            keyword"推荐"
            , with_coupontrue
            , page_size20
            , page1
            , sort_type1
            , list_id''
        })
      }catch(e){
        console.log(e);
      }
    console.log(e)
}
search()

License

MIT

Releases

No releases published

Packages

No packages published