Skip to content

Commit 003c7f9

Browse files
author
changfeng
committed
fix: increase fetch package size timeout
1 parent 9fb7c08 commit 003c7f9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ import { workspaceRoot } from 'workspace-root';
1111

1212
import { memoizeAsync, getPkgSize as _getPkgSize } from './utils';
1313

14-
export interface Options {}
14+
export interface Options {
15+
fetchPkgInfoTimeout?: number;
16+
}
1517

1618
const getWorkspaceRootFolder = memoizeAsync(async () => {
1719
let workspaceRootFolder = await workspaceRoot();

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export async function getPkgSize(name: string, version: string) {
6666
resp = await axios.get<GetPkgSizeResponseData>(
6767
`https://bundlephobia.com/api/size?package=${name}@${version}`,
6868
{
69-
timeout: 6666,
69+
timeout: 10 * 1000,
7070
},
7171
);
7272
} catch {

0 commit comments

Comments
 (0)