@wargas/crawler 0.0.3 → 0.0.4
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/bun.lock +5 -2
- package/dist/index.js +3 -1
- package/index.d.ts +15 -0
- package/index.test.ts +1 -1
- package/index.ts +4 -4
- package/package.json +4 -3
package/bun.lock
CHANGED
|
@@ -12,9 +12,10 @@
|
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"@types/bun": "latest",
|
|
15
|
+
"tsc": "^2.0.4",
|
|
15
16
|
},
|
|
16
17
|
"peerDependencies": {
|
|
17
|
-
"typescript": "^
|
|
18
|
+
"typescript": "^6.0.3",
|
|
18
19
|
},
|
|
19
20
|
},
|
|
20
21
|
},
|
|
@@ -103,9 +104,11 @@
|
|
|
103
104
|
|
|
104
105
|
"tough-cookie-file-store": ["tough-cookie-file-store@3.3.0", "", { "dependencies": { "tough-cookie": "^6.0.0" } }, "sha512-FbO/cOi/jp4wweo8soVNG/ZjDsgpBZWqaxWwu7gRKvsjg/Qt44kStp87VLfJnin749DlTbZDYvV1wuSr5jly2g=="],
|
|
105
106
|
|
|
107
|
+
"tsc": ["tsc@2.0.4", "", { "bin": { "tsc": "bin/tsc" } }, "sha512-fzoSieZI5KKJVBYGvwbVZs/J5za84f2lSTLPYf6AGiIf43tZ3GNrI1QzTLcjtyDDP4aLxd46RTZq1nQxe7+k5Q=="],
|
|
108
|
+
|
|
106
109
|
"type-fest": ["type-fest@5.6.0", "", { "dependencies": { "tagged-tag": "^1.0.0" } }, "sha512-8ZiHFm91orbSAe2PSAiSVBVko18pbhbiB3U9GglSzF/zCGkR+rxpHx6sEMCUm4kxY4LjDIUGgCfUMtwfZfjfUA=="],
|
|
107
110
|
|
|
108
|
-
"typescript": ["typescript@
|
|
111
|
+
"typescript": ["typescript@6.0.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw=="],
|
|
109
112
|
|
|
110
113
|
"uhyphen": ["uhyphen@0.2.0", "", {}, "sha512-qz3o9CHXmJJPGBdqzab7qAYuW8kQGKNEuoHFYrBwV6hWIMcpAmxDLXojcHfFr9US1Pe6zUswEIJIbLI610fuqA=="],
|
|
111
114
|
|
package/dist/index.js
CHANGED
|
@@ -23300,7 +23300,9 @@ class Crawler {
|
|
|
23300
23300
|
return res;
|
|
23301
23301
|
}
|
|
23302
23302
|
]
|
|
23303
|
-
}
|
|
23303
|
+
},
|
|
23304
|
+
followRedirect: false,
|
|
23305
|
+
cookieJar: instance.cookieJar
|
|
23304
23306
|
});
|
|
23305
23307
|
return instance;
|
|
23306
23308
|
}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// crawler.d.ts
|
|
2
|
+
|
|
3
|
+
import type { Got } from "got";
|
|
4
|
+
import type { CookieJar } from "tough-cookie";
|
|
5
|
+
|
|
6
|
+
export declare class Crawler {
|
|
7
|
+
client: Got;
|
|
8
|
+
cookieJar: CookieJar;
|
|
9
|
+
html: string;
|
|
10
|
+
document: Document;
|
|
11
|
+
|
|
12
|
+
static factory(): Crawler;
|
|
13
|
+
|
|
14
|
+
removeAllCookies(): Promise<void>;
|
|
15
|
+
}
|
package/index.test.ts
CHANGED
package/index.ts
CHANGED
|
@@ -8,7 +8,7 @@ export class Crawler {
|
|
|
8
8
|
client!: Got
|
|
9
9
|
cookieJar!: CookieJar
|
|
10
10
|
html = ``
|
|
11
|
-
document = parseHTML(``).document
|
|
11
|
+
document: Document = parseHTML(``).document
|
|
12
12
|
|
|
13
13
|
static factory() {
|
|
14
14
|
const instance = new Crawler()
|
|
@@ -27,9 +27,9 @@ export class Crawler {
|
|
|
27
27
|
return res
|
|
28
28
|
}
|
|
29
29
|
]
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
},
|
|
31
|
+
followRedirect:false,
|
|
32
|
+
cookieJar: instance.cookieJar,
|
|
33
33
|
|
|
34
34
|
})
|
|
35
35
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wargas/crawler",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"module": "index.ts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -10,10 +10,11 @@
|
|
|
10
10
|
"publish": "npm publish --tag latest --access public"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@types/bun": "latest"
|
|
13
|
+
"@types/bun": "latest",
|
|
14
|
+
"tsc": "^2.0.4"
|
|
14
15
|
},
|
|
15
16
|
"peerDependencies": {
|
|
16
|
-
"typescript": "^
|
|
17
|
+
"typescript": "^6.0.3"
|
|
17
18
|
},
|
|
18
19
|
"dependencies": {
|
|
19
20
|
"got": "^15.0.5",
|