Node SDK for yuque
Install
npm i node-yuque --save
Usage
const SDK = ;const client = token: '<YOUR TOKEN>' // other options; const result = await clientusers;console; // apisconst users groups repos docs = client;
Options
/** * @param * @param * @param * @param * @param * @param */
by default, will return response.data.data
, you can custom it by handler
:
{ // should handler error yourself if resstatus !== 200 const err = resdatamessage; /* istanbul ignore next */ errstatus = resdatastatus || resstatus; errcode = resdatacode; errdata = res; throw err; // return whatever you want const data abilities = resdata; return data; };
Debug
$ http_proxy=http://127.0.0.1:8888 TOKEN=<YOUR_TOKEN> npm test
API
see Yuque API Docs for more details.
users
see the source.
groups
see the source.
repos
see the source.
docs
see the source.
TODO
- API docs
- JSDocs definition for result info
- add
d.ts
or refactor to TypeScript