All Projects → mbxc → node-topsdk

mbxc / node-topsdk

Licence: MIT license
Taobao top sdk

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to node-topsdk

opentaobao-go
🎉淘宝Api、淘宝开放平台Api请求基础SDK
Stars: ✭ 12 (-53.85%)
Mutual labels:  taobao-sdk
go-opentaobao
🎉淘宝Api、淘宝开放平台Api请求基础SDK
Stars: ✭ 55 (+111.54%)
Mutual labels:  taobao-sdk
tbk-union-sdk
淘宝联盟SDK,淘宝客 支持fpm和swoole模式
Stars: ✭ 43 (+65.38%)
Mutual labels:  taobao-top-sdk

Taobao TOP API Node SDK

Travis CI Build Status NPM Version NPM Downloads Dependency Status

Based on official API definition and written with minimum dependencies.

innopals

Features

  1. Support promise.
  2. Support piping top response to writable stream.
  3. Auto-generated validator for each api stub, and support useValidators options to turn it on/off.
  4. Upload Picture (beta)
  5. Parse large numbers from top api result (gt. Number.MAX_SAFE_INTEGER or lt Number.MIN_SAFE_INTEGER) into strings
  6. TypeScript module definition

Get Started

Default Configurable Options

new TopClient(key, secret, {
  endpoint: 'https://eco.taobao.com/router/rest',
  useValidators: true,
  rawResponse: false
});

Most Common Usage

(async function() {
  const data = await client.execute('taobao.mixnick.get', { nick: 'test' });
  console.log(data.nick);
})();

More...

Pipe To Stream

// const app = express();
app.get((req, res) => {
  client.execute('taobao.mixnick.get', { nick: req.query.nick }).pipe(res);
});

More...

Using Upload API

(async function() {
  const data = await client.execute('taobao.picture.upload', {
    session: session,
    picture_category_id: 0,
    img: fs.createReadStream(path.join(__dirname, 'ok.png')),
    image_input_title: 'ok.png',
    title: 'topsdk test image'
  }, 'FILE_UPLOAD');
  console.log(data);
})();

More...

Contributing

This project welcomes contributions from the community. Contributions are accepted using GitHub pull requests. If you're not familiar with making GitHub pull requests, please refer to the GitHub documentation "Creating a pull request".

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].