seafile-js 0.2.224 → 0.2.225

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seafile-js",
3
- "version": "0.2.224",
3
+ "version": "0.2.225",
4
4
  "private": false,
5
5
  "main": "lib/seafile-api.js",
6
6
  "dependencies": {
@@ -12,7 +12,6 @@
12
12
  "build": "node_modules/.bin/babel src --out-dir lib",
13
13
  "prepublishOnly": "npm run build"
14
14
  },
15
- "jest": { },
16
15
  "author": "Seafile",
17
16
  "license": "ISC",
18
17
  "devDependencies": {
package/readme.md CHANGED
@@ -7,23 +7,30 @@ This is JavaScript API for Seafile.
7
7
 
8
8
  Install seafile-js package:
9
9
 
10
- ```
10
+ ```bash
11
11
  npm install seafile-js
12
12
  ```
13
13
 
14
14
  In your project:
15
15
 
16
- ```
16
+ ```js
17
17
  const { SeafileAPI } = require('seafile-js')
18
18
 
19
- server = "xxx"
20
- username = "xxx"
21
- password = "xxx"
22
- const seafileAPI = new SeafileAPI(server, username, password)
19
+ const server = 'xxx'
20
+ const username = 'xxx'
21
+ const password = 'xxx'
22
+ const seafileAPI = new SeafileAPI()
23
+
24
+ seafileAPI.init({ server, username, password })
23
25
 
24
26
  seafileAPI.login().then((response) => {
25
27
  seafileAPI.authPing().then((response) => {
26
- console.log(response.data);
27
- });
28
+ console.log(response)
29
+ }).catch((err) => {
30
+ console.log('error', err);
31
+ })
32
+ })
33
+ .catch((err) => {
34
+ console.log('error',err.config)
28
35
  })
29
36
  ```