@mendable/firecrawl-js 0.0.1 → 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.
Files changed (3) hide show
  1. package/README.md +21 -7
  2. package/package.json +11 -2
  3. package/src/index.ts +1 -1
package/README.md CHANGED
@@ -7,7 +7,7 @@ The Firecrawl JavaScript SDK is a library that allows you to easily scrape and c
7
7
  To install the Firecrawl JavaScript SDK, you can use npm:
8
8
 
9
9
  ```bash
10
- npm install @mendableai/firecrawl-js
10
+ npm install @mendable/firecrawl-js
11
11
  ```
12
12
 
13
13
  ## Usage
@@ -19,12 +19,12 @@ npm install @mendableai/firecrawl-js
19
19
  Here's an example of how to use the SDK with error handling:
20
20
 
21
21
  ```js
22
- import { FirecrawlApp } from '@mendableai/firecrawl-js';
22
+ import { FirecrawlApp } from '@mendable/firecrawl-js';
23
23
 
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('Error occurred while scraping:', error.message);
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(crawlUrl, crawlParams, waitUntilDone, timeout);
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('Error occurred while crawling:', error.message);
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('Error occurred while checking crawl status:', error.message);
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.1",
3
+ "version": "0.0.4",
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
  }
package/src/index.ts CHANGED
@@ -134,4 +134,4 @@ class FirecrawlApp {
134
134
  }
135
135
  }
136
136
 
137
- export { FirecrawlApp }
137
+ export default FirecrawlApp;