File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " git-repo-loader" ,
3- "version" : " 1.0.0 " ,
3+ "version" : " 1.0.2 " ,
44 "description" : " A lightweight library to fetch and stream GitHub repository content efficiently with rate-limit handling." ,
55 "type" : " module" ,
66 "main" : " dist/index.js" ,
77 "types" : " dist/index.d.ts" ,
88 "scripts" : {
9- "build" : " tsup"
9+ "build" : " tsup" ,
10+ "prepublishOnly" : " npm run build"
1011 },
1112 "repository" : {
1213 "type" : " git" ,
Original file line number Diff line number Diff line change @@ -10,13 +10,15 @@ export class GitHubRepoLoader {
1010
1111 constructor (
1212 authToken : string ,
13- {
14- concurrency = 50 ,
15- intervalMs = 3600000 ,
16- requestsPerInterval = 5000 , // https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28
17- retries,
18- } : RateLimitConfig
13+ options ?: Partial < RateLimitConfig >
1914 ) {
15+ const {
16+ concurrency = 1 ,
17+ intervalMs = 1000 ,
18+ requestsPerInterval = 1 ,
19+ retries = 3 ,
20+ } = options || { } ;
21+
2022 this . octokit = new Octokit ( { auth : authToken } ) ;
2123
2224 this . rateLimitManager = new RateLimitManager ( {
You can’t perform that action at this time.
0 commit comments