@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 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": "^5",
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@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
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
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from 'bun:test'
2
- import { Crawler } from "./index";
2
+ import { Crawler } from "./";
3
3
 
4
4
  test(`get page title`, async function() {
5
5
 
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
- // followRedirect:false,
32
- // cookieJar: instance.cookieJar,
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",
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": "^5"
17
+ "typescript": "^6.0.3"
17
18
  },
18
19
  "dependencies": {
19
20
  "got": "^15.0.5",