stock-sdk 1.1.1 → 1.1.2

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/LICENSE CHANGED
@@ -1,22 +1,15 @@
1
- MIT License
1
+ ISC License
2
2
 
3
3
  Copyright (c) 2025 chengzuopeng
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
22
-
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
+ PERFORMANCE OF THIS SOFTWARE.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/stock-sdk.svg)](https://www.npmjs.com/package/stock-sdk)
4
4
  [![npm downloads](https://img.shields.io/npm/dm/stock-sdk.svg)](https://www.npmjs.com/package/stock-sdk)
5
- [![GitHub](https://img.shields.io/github/license/chengzuopeng/stock-sdk)](https://github.com/chengzuopeng/stock-sdk)
5
+ [![license](https://img.shields.io/npm/l/stock-sdk)](https://github.com/chengzuopeng/stock-sdk/blob/master/LICENSE)
6
6
 
7
7
  基于腾讯财经 `qt.gtimg.cn` 非官方接口封装的 TypeScript SDK,支持 A 股、港股、美股、公募基金实时行情查询。
8
8
 
@@ -117,10 +117,12 @@ console.log(quotes[0].price); // 111.70
117
117
 
118
118
  返回的每只股票数据格式与 `getFullQuotes` 相同。
119
119
 
120
+ > ⚠️ **提示**:如果请求过程中遇到超时或报错,请尝试将 `batchSize` 设置得更小,例如 `100`。
121
+
120
122
  **参数**
121
123
 
122
124
  - `options` — 可选配置对象
123
- - `batchSize` — 单次请求的股票数量,默认 `700`
125
+ - `batchSize` — 单次请求的股票数量,默认 `500`
124
126
  - `concurrency` — 最大并发请求数,默认 `7`
125
127
  - `onProgress` — 进度回调函数 `(completed: number, total: number) => void`
126
128
 
@@ -133,7 +135,7 @@ console.log(`共获取 ${allQuotes.length} 只股票行情`);
133
135
 
134
136
  // 自定义配置
135
137
  const allQuotes = await sdk.getAllAShareQuotes({
136
- batchSize: 500, // 每次请求 500
138
+ batchSize: 300, // 每次请求 300
137
139
  concurrency: 3, // 最多 3 个并发
138
140
  onProgress: (completed, total) => {
139
141
  console.log(`进度: ${completed}/${total}`);
@@ -440,4 +442,4 @@ yarn build
440
442
 
441
443
  ## 许可证
442
444
 
443
- MIT
445
+ ISC