@mendable/firecrawl-js 0.0.1 → 0.0.2
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/README.md +19 -5
- package/package.json +11 -2
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ Here's an example of how to use the SDK with error handling:
|
|
|
24
24
|
async function main() {
|
|
25
25
|
try {
|
|
26
26
|
// Initialize the FirecrawlApp with your API key
|
|
27
|
-
const app = new FirecrawlApp({apiKey: "YOUR_API_KEY"});
|
|
27
|
+
const app = new FirecrawlApp({ apiKey: "YOUR_API_KEY" });
|
|
28
28
|
|
|
29
29
|
// Scrape a single URL
|
|
30
30
|
const url = 'https://mendable.ai';
|
|
@@ -64,7 +64,10 @@ To scrape a single URL with error handling, use the `scrapeUrl` method. It takes
|
|
|
64
64
|
console.log(scrapedData);
|
|
65
65
|
|
|
66
66
|
} catch (error) {
|
|
67
|
-
console.error(
|
|
67
|
+
console.error(
|
|
68
|
+
'Error occurred while scraping:',
|
|
69
|
+
error.message
|
|
70
|
+
);
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
73
|
|
|
@@ -89,12 +92,20 @@ async function crawlExample() {
|
|
|
89
92
|
};
|
|
90
93
|
const waitUntilDone = true;
|
|
91
94
|
const timeout = 5;
|
|
92
|
-
const crawlResult = await app.crawlUrl(
|
|
95
|
+
const crawlResult = await app.crawlUrl(
|
|
96
|
+
crawlUrl,
|
|
97
|
+
crawlParams,
|
|
98
|
+
waitUntilDone,
|
|
99
|
+
timeout
|
|
100
|
+
);
|
|
93
101
|
|
|
94
102
|
console.log(crawlResult);
|
|
95
103
|
|
|
96
104
|
} catch (error) {
|
|
97
|
-
console.error(
|
|
105
|
+
console.error(
|
|
106
|
+
'Error occurred while crawling:',
|
|
107
|
+
error.message
|
|
108
|
+
);
|
|
98
109
|
}
|
|
99
110
|
}
|
|
100
111
|
|
|
@@ -113,7 +124,10 @@ async function checkStatusExample(jobId) {
|
|
|
113
124
|
console.log(status);
|
|
114
125
|
|
|
115
126
|
} catch (error) {
|
|
116
|
-
console.error(
|
|
127
|
+
console.error(
|
|
128
|
+
'Error occurred while checking crawl status:',
|
|
129
|
+
error.message
|
|
130
|
+
);
|
|
117
131
|
}
|
|
118
132
|
}
|
|
119
133
|
// Example usage, assuming you have a jobId
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mendable/firecrawl-js",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "JavaScript SDK for Firecrawl API",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -24,5 +24,14 @@
|
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/node": "^20.12.7",
|
|
26
26
|
"typescript": "^5.4.5"
|
|
27
|
-
}
|
|
27
|
+
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"firecrawl",
|
|
30
|
+
"mendable",
|
|
31
|
+
"crawler",
|
|
32
|
+
"web",
|
|
33
|
+
"scraper",
|
|
34
|
+
"api",
|
|
35
|
+
"sdk"
|
|
36
|
+
]
|
|
28
37
|
}
|