1.1.4 • Published 7 years ago

node-tim v1.1.4

Weekly downloads
1
License
ISC
Repository
-
Last release
7 years ago
                      __                __     _             
   ____   ____   ____/ /  ___          / /_   (_)   ____ ___ 
  / __ \ / __ \ / __  /  / _ \ ______ / __/  / /   / __ `__ \
 / / / // /_/ // /_/ /  /  __//_____// /_   / /   / / / / / /
/_/ /_/ \____/ \__,_/   \___/        \__/  /_/   /_/ /_/ /_/ 
                                                             

node sdk for Tim

Standard - JavaScript Style Guide Build Status

Installation

yarn add node-tim

Options

Initialize Tim plugin with the given options.

Tim(access_token, { host: "", protocol: "" })

Options:

  • access_token 用户通过Teambition Account授权获取到的token, 用于验证请求是否合法并经过用户授权
  • host 非必需参数, 指定API地址s

Usage

  • callback
let accessToken = 'Tim accessToken'
let tim = new Tim(accessToken)

tim.get('/users/me', (err, data) => {
  // user's profile
  if (err) throw err
  console.log(data)
})
  • promise
let accessToken = 'Tim accessToken'
let tim = new Tim(accessToken)
tim
  .get('/users/me')
  .then(userprofile => console.log(userprofile))
  .catch(err => console.error(err))

License

ISC License

Copyright (c) 2017

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.0

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago