Skip to content

Commit e4d5809

Browse files
committed
chore: update README
1 parent 867c91c commit e4d5809

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,13 @@ npm i jike-sdk
7070
如果使用 ESM 方式导入,需要把 `package.json``type` 设置为 `module`,或将后缀名改为 `.mjs`
7171

7272
```ts
73+
// index.mjs
74+
7375
// 自带 node-fetch
74-
import { setApiConfig } from 'jike-sdk/node'
76+
import { setApiConfig } from 'jike-sdk'
7577

76-
// 不带 node-fetch,需要自行 ployfill 或使用最新 Node.js
77-
// import { api, setAccessToken, ApiClient } from 'jike-sdk'
78+
// 不带 node-fetch,需要自行 ployfill 或使用最新 Node.js,且需要自行安装 ky
79+
// import { setApiConfig } from 'jike-sdk/index'
7880

7981
setApiConfig({
8082
// ...
@@ -84,12 +86,10 @@ setApiConfig({
8486
#### CJS 导入
8587

8688
```ts
87-
;(async () => {
88-
const { setApiConfig } = await import('jike-sdk/node')
89-
setApiConfig({
90-
// ...
91-
})
92-
})()
89+
const { setApiConfig } = require('jike-sdk')
90+
setApiConfig({
91+
// ...
92+
})
9393
```
9494

9595
### Deno

0 commit comments

Comments
 (0)