fetchfox-sdk 1.0.0 → 1.0.1
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/package.json +1 -1
- package/src/crawl.js +2 -2
- package/src/extract.js +2 -2
- package/src/index.js +1 -0
- package/src/jobs.js +3 -1
- package/src/scrape.js +5 -0
- package/tests/crawl.test.js +4 -1
package/package.json
CHANGED
package/src/crawl.js
CHANGED
package/src/extract.js
CHANGED
package/src/index.js
CHANGED
package/src/jobs.js
CHANGED
|
@@ -4,7 +4,9 @@ export const jobs = {
|
|
|
4
4
|
get: async (id) => {
|
|
5
5
|
return call('GET', `/api/jobs/${id}`);
|
|
6
6
|
},
|
|
7
|
-
list: async (
|
|
7
|
+
list: async (args) => {
|
|
8
|
+
const limit = args?.limit ?? 100;
|
|
9
|
+
const offset = args?.offset ?? 0;
|
|
8
10
|
return call('GET', '/api/jobs', { limit, offset });
|
|
9
11
|
},
|
|
10
12
|
};
|
package/src/scrape.js
ADDED
package/tests/crawl.test.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { crawl } from '../src';
|
|
2
2
|
|
|
3
3
|
test('crawl a pattern @sanity', async () => {
|
|
4
|
-
const out = await crawl(
|
|
4
|
+
const out = await crawl({
|
|
5
|
+
pattern: 'https://pokemondb.net/pokedex/*',
|
|
6
|
+
maxVisits: 5,
|
|
7
|
+
});
|
|
5
8
|
console.log(out);
|
|
6
9
|
}, 30_000);
|