New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

topsdk

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

topsdk

Taobao Open API Client for nodejs.

latest
Source
npmnpm
Version
1.0.13
Version published
Weekly downloads
21
61.54%
Maintainers
1
Weekly downloads
 
Created
Source

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

  • Support promise.
  • Support piping top response to writable stream.
  • Auto-generated validator for each api stub, and support useValidators options to turn it on/off.
  • Upload Picture (beta)
  • Parse large numbers from top api result (gt. Number.MAX_SAFE_INTEGER or lt Number.MIN_SAFE_INTEGER) into strings
  • 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".

Keywords

top

FAQs

Package last updated on 11 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts