serpex 2.0.2 → 2.3.0
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 +158 -58
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -15
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +5 -16
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +8 -7
package/README.md
CHANGED
|
@@ -20,22 +20,20 @@ import { SerpexClient } from 'serpex';
|
|
|
20
20
|
// Initialize the client with your API key
|
|
21
21
|
const client = new SerpexClient('your-api-key-here');
|
|
22
22
|
|
|
23
|
-
// Search with
|
|
24
|
-
const
|
|
23
|
+
// Search with auto-routing (recommended)
|
|
24
|
+
const results = await client.search({
|
|
25
25
|
q: 'typescript tutorial',
|
|
26
|
-
engine: '
|
|
27
|
-
hl: 'en'
|
|
26
|
+
engine: 'auto'
|
|
28
27
|
});
|
|
29
28
|
|
|
30
|
-
// Search with
|
|
31
|
-
const
|
|
29
|
+
// Search with specific engine
|
|
30
|
+
const googleResults = await client.search({
|
|
32
31
|
q: 'typescript tutorial',
|
|
33
|
-
engine: '
|
|
34
|
-
mkt: 'en-US'
|
|
32
|
+
engine: 'google'
|
|
35
33
|
});
|
|
36
34
|
|
|
35
|
+
console.log(results.results[0].title);
|
|
37
36
|
console.log(googleResults.results[0].title);
|
|
38
|
-
console.log(bingResults.results[0].title);
|
|
39
37
|
```
|
|
40
38
|
|
|
41
39
|
## API Reference
|
|
@@ -53,34 +51,59 @@ new SerpexClient(apiKey: string, baseUrl?: string)
|
|
|
53
51
|
|
|
54
52
|
#### Methods
|
|
55
53
|
|
|
56
|
-
##### `
|
|
54
|
+
##### `extract(params: ExtractParams): Promise<ExtractResponse>`
|
|
57
55
|
|
|
58
|
-
|
|
56
|
+
Extract content from web pages and convert them to LLM-ready markdown data. Accepts up to 10 URLs per request.
|
|
59
57
|
|
|
60
58
|
```typescript
|
|
61
|
-
const results = await client.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
const results = await client.extract({
|
|
60
|
+
urls: [
|
|
61
|
+
'https://example.com',
|
|
62
|
+
'https://httpbin.org'
|
|
63
|
+
]
|
|
65
64
|
});
|
|
66
65
|
```
|
|
67
66
|
|
|
68
|
-
|
|
67
|
+
## Extract Parameters
|
|
68
|
+
|
|
69
|
+
The `ExtractParams` interface supports extraction parameters:
|
|
69
70
|
|
|
70
71
|
```typescript
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
72
|
+
interface ExtractParams {
|
|
73
|
+
// Required: URLs to extract (max 10)
|
|
74
|
+
urls: string[];
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Extract Response Format
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
interface ExtractResponse {
|
|
82
|
+
success: boolean;
|
|
83
|
+
results: ExtractResult[];
|
|
84
|
+
metadata: ExtractMetadata;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
interface ExtractResult {
|
|
88
|
+
url: string;
|
|
89
|
+
success: boolean;
|
|
90
|
+
markdown?: string;
|
|
91
|
+
error?: string;
|
|
92
|
+
error_type?: string;
|
|
93
|
+
status_code?: number;
|
|
94
|
+
crawled_at?: string;
|
|
95
|
+
extraction_mode?: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
interface ExtractMetadata {
|
|
99
|
+
total_urls: number;
|
|
100
|
+
processed_urls: number;
|
|
101
|
+
successful_crawls: number;
|
|
102
|
+
failed_crawls: number;
|
|
103
|
+
credits_used: number;
|
|
104
|
+
response_time: number;
|
|
105
|
+
timestamp: string;
|
|
106
|
+
}
|
|
84
107
|
```
|
|
85
108
|
|
|
86
109
|
## Search Parameters
|
|
@@ -89,38 +112,33 @@ The `SearchParams` interface supports all search parameters:
|
|
|
89
112
|
|
|
90
113
|
```typescript
|
|
91
114
|
interface SearchParams {
|
|
92
|
-
// Required:
|
|
93
|
-
q
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
hl?: string; // language
|
|
107
|
-
lr?: string; // language restrict
|
|
108
|
-
cr?: string; // country restrict
|
|
109
|
-
|
|
110
|
-
// Bing specific
|
|
111
|
-
mkt?: string; // market
|
|
112
|
-
|
|
113
|
-
// DuckDuckGo specific
|
|
114
|
-
region?: string;
|
|
115
|
-
|
|
116
|
-
// Brave specific
|
|
117
|
-
category?: string;
|
|
118
|
-
spellcheck?: boolean;
|
|
119
|
-
ui_lang?: string;
|
|
120
|
-
country?: string;
|
|
115
|
+
// Required: search query
|
|
116
|
+
q: string;
|
|
117
|
+
|
|
118
|
+
// Optional: Engine selection (defaults to 'auto')
|
|
119
|
+
engine?: 'auto' | 'google' | 'bing' | 'duckduckgo' | 'brave' | 'yahoo' | 'yandex';
|
|
120
|
+
|
|
121
|
+
// Optional: Search category (currently only 'web' supported)
|
|
122
|
+
category?: 'web';
|
|
123
|
+
|
|
124
|
+
// Optional: Time range filter
|
|
125
|
+
time_range?: 'all' | 'day' | 'week' | 'month' | 'year';
|
|
126
|
+
|
|
127
|
+
// Optional: Response format
|
|
128
|
+
format?: 'json' | 'csv' | 'rss';
|
|
121
129
|
}
|
|
122
130
|
```
|
|
123
131
|
|
|
132
|
+
## Supported Engines
|
|
133
|
+
|
|
134
|
+
- **auto**: Automatically routes to the best available search engine
|
|
135
|
+
- **google**: Google's primary search engine
|
|
136
|
+
- **bing**: Microsoft's search engine
|
|
137
|
+
- **duckduckgo**: Privacy-focused search engine
|
|
138
|
+
- **brave**: Privacy-first search engine
|
|
139
|
+
- **yahoo**: Yahoo search engine
|
|
140
|
+
- **yandex**: Russian search engine
|
|
141
|
+
|
|
124
142
|
## Response Format
|
|
125
143
|
|
|
126
144
|
```typescript
|
|
@@ -170,6 +188,88 @@ try {
|
|
|
170
188
|
}
|
|
171
189
|
```
|
|
172
190
|
|
|
191
|
+
## Examples
|
|
192
|
+
|
|
193
|
+
### Basic Search
|
|
194
|
+
```typescript
|
|
195
|
+
const results = await client.search({
|
|
196
|
+
q: 'coffee shops near me'
|
|
197
|
+
});
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Advanced Search with Filters
|
|
201
|
+
```typescript
|
|
202
|
+
const results = await client.search({
|
|
203
|
+
q: 'latest AI news',
|
|
204
|
+
engine: 'google',
|
|
205
|
+
time_range: 'day',
|
|
206
|
+
category: 'web'
|
|
207
|
+
});
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Extract Web Content to LLM-Ready Data
|
|
211
|
+
|
|
212
|
+
#### Extract from a Single URL
|
|
213
|
+
```typescript
|
|
214
|
+
// Extract content from one website
|
|
215
|
+
const result = await client.extract({
|
|
216
|
+
urls: ['https://example.com']
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
if (result.results[0].success) {
|
|
220
|
+
console.log(`✅ Extracted ${result.results[0].markdown?.length} characters`);
|
|
221
|
+
console.log('Markdown content:', result.results[0].markdown?.substring(0, 200) + '...');
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
#### Extract from Multiple URLs (up to 10 at once)
|
|
226
|
+
```typescript
|
|
227
|
+
// Extract content from multiple websites (up to 10 URLs)
|
|
228
|
+
const extractResults = await client.extract({
|
|
229
|
+
urls: [
|
|
230
|
+
'https://example.com',
|
|
231
|
+
'https://httpbin.org',
|
|
232
|
+
'https://github.com'
|
|
233
|
+
]
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
console.log(`Successfully extracted ${extractResults.metadata.successful_crawls} pages`);
|
|
237
|
+
console.log(`Total credits used: ${extractResults.metadata.credits_used}`);
|
|
238
|
+
|
|
239
|
+
extractResults.results.forEach(result => {
|
|
240
|
+
if (result.success) {
|
|
241
|
+
console.log(`✅ ${result.url}: ${result.markdown?.length} characters`);
|
|
242
|
+
// Use result.markdown for LLM processing
|
|
243
|
+
} else {
|
|
244
|
+
console.log(`❌ ${result.url}: ${result.error}`);
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
#### Sample Response
|
|
250
|
+
```typescript
|
|
251
|
+
// Example response structure
|
|
252
|
+
{
|
|
253
|
+
success: true,
|
|
254
|
+
results: [
|
|
255
|
+
{
|
|
256
|
+
url: 'https://example.com',
|
|
257
|
+
success: true,
|
|
258
|
+
markdown: '# Example Domain\n\nThis domain is for use in...',
|
|
259
|
+
status_code: 200
|
|
260
|
+
}
|
|
261
|
+
],
|
|
262
|
+
metadata: {
|
|
263
|
+
total_urls: 1,
|
|
264
|
+
processed_urls: 1,
|
|
265
|
+
successful_crawls: 1,
|
|
266
|
+
failed_crawls: 0,
|
|
267
|
+
credits_used: 3,
|
|
268
|
+
response_time: 255,
|
|
269
|
+
timestamp: '2025-11-13T10:30:00.000Z'
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
```
|
|
173
273
|
|
|
174
274
|
## License
|
|
175
275
|
|
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare class SerpexClient {
|
|
|
15
15
|
private makeRequest;
|
|
16
16
|
/**
|
|
17
17
|
* Search using the SERP API
|
|
18
|
-
* @param params - Search parameters including query, engine,
|
|
18
|
+
* @param params - Search parameters including query, engine, category, time_range
|
|
19
19
|
* @returns Search results
|
|
20
20
|
*/
|
|
21
21
|
search(params: SearchParams): Promise<SearchResponse>;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,YAAY,EACZ,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAE1D,qBAAa,YAAY;IACvB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAS;IAEvB;;;;OAIG;gBACS,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,MAAiC;IAStE;;OAEG;YACW,WAAW;IA6CzB;;;;OAIG;IACG,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,YAAY,EACZ,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAE1D,qBAAa,YAAY;IACvB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAS;IAEvB;;;;OAIG;gBACS,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,MAAiC;IAStE;;OAEG;YACW,WAAW;IA6CzB;;;;OAIG;IACG,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC;CAwB5D"}
|
package/dist/index.js
CHANGED
|
@@ -57,29 +57,27 @@ class SerpexClient {
|
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
59
|
* Search using the SERP API
|
|
60
|
-
* @param params - Search parameters including query, engine,
|
|
60
|
+
* @param params - Search parameters including query, engine, category, time_range
|
|
61
61
|
* @returns Search results
|
|
62
62
|
*/
|
|
63
63
|
async search(params) {
|
|
64
|
-
if (!params.q
|
|
65
|
-
throw new Error('Query parameter (q
|
|
64
|
+
if (!params.q) {
|
|
65
|
+
throw new Error('Query parameter (q) is required');
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
if (typeof searchQuery !== 'string' || searchQuery.trim().length === 0) {
|
|
67
|
+
if (typeof params.q !== 'string' || params.q.trim().length === 0) {
|
|
69
68
|
throw new Error('Query must be a non-empty string');
|
|
70
69
|
}
|
|
71
|
-
if (
|
|
70
|
+
if (params.q.length > 500) {
|
|
72
71
|
throw new Error('Query too long (max 500 characters)');
|
|
73
72
|
}
|
|
74
|
-
// Prepare request parameters
|
|
75
|
-
const requestParams = {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
requestParams.engine = params.engine;
|
|
73
|
+
// Prepare request parameters with only supported params
|
|
74
|
+
const requestParams = {
|
|
75
|
+
q: params.q,
|
|
76
|
+
engine: params.engine || 'auto', // Default to auto
|
|
77
|
+
category: params.category || 'web',
|
|
78
|
+
time_range: params.time_range || 'all',
|
|
79
|
+
format: params.format || 'json'
|
|
80
|
+
};
|
|
83
81
|
return this.makeRequest('/api/search', requestParams);
|
|
84
82
|
}
|
|
85
83
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAIiB;AAEsB,iGAHrC,wBAAgB,OAGqC;AAEvD,MAAa,YAAY;IAIvB;;;;OAIG;IACH,YAAY,MAAc,EAAE,UAAkB,wBAAwB;QACpE,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC1C,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;QAC9D,CAAC;QAED,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,wBAAwB;IACrE,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,WAAW,CAAC,QAAgB,EAAE,SAA8B,EAA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CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACrD,CAAC;QAED,IAAI,OAAO,MAAM,CAAC,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACjE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;QACtD,CAAC;QAED,IAAI,MAAM,CAAC,CAAC,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;QACzD,CAAC;QAED,wDAAwD;QACxD,MAAM,aAAa,GAAwB;YACzC,CAAC,EAAE,MAAM,CAAC,CAAC;YACX,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,MAAM,EAAE,kBAAkB;YACnD,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,KAAK;YAClC,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,KAAK;YACtC,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,MAAM;SAChC,CAAC;QAEF,OAAO,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;IACxD,CAAC;CACF;AA/FD,oCA+FC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -27,22 +27,11 @@ export interface SearchResponse {
|
|
|
27
27
|
suggestions: string[];
|
|
28
28
|
}
|
|
29
29
|
export interface SearchParams {
|
|
30
|
-
q
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
page?: number;
|
|
36
|
-
time_range?: string;
|
|
37
|
-
hl?: string;
|
|
38
|
-
lr?: string;
|
|
39
|
-
cr?: string;
|
|
40
|
-
mkt?: string;
|
|
41
|
-
region?: string;
|
|
42
|
-
category?: string;
|
|
43
|
-
spellcheck?: boolean;
|
|
44
|
-
ui_lang?: string;
|
|
45
|
-
country?: string;
|
|
30
|
+
q: string;
|
|
31
|
+
engine?: 'auto' | 'google' | 'bing' | 'duckduckgo' | 'brave' | 'yahoo' | 'yandex';
|
|
32
|
+
category?: 'web';
|
|
33
|
+
time_range?: 'all' | 'day' | 'week' | 'month' | 'year';
|
|
34
|
+
format?: 'json' | 'csv' | 'rss';
|
|
46
35
|
}
|
|
47
36
|
export interface SerpApiError {
|
|
48
37
|
error: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,cAAc,CAAC;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,OAAO,EAAE,GAAG,EAAE,CAAC;IACf,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,EAAE,GAAG,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,YAAY;IAE3B,CAAC,
|
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AK,CAAC;CACjC;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpC,SAAgB,OAAO,CAAC,EAAE,GAAG,CAAC;gBAElB,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG;CAMhE"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,qCAAqC;AACrC,uBAAuB;;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,qCAAqC;AACrC,uBAAuB;;;AA0DvB,MAAa,gBAAiB,SAAQ,KAAK;IAIzC,YAAY,OAAe,EAAE,UAAmB,EAAE,OAAa;QAC7D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AAVD,4CAUC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "serpex",
|
|
3
|
-
"version": "2.0
|
|
4
|
-
"description": "Official TypeScript SDK for Serpex
|
|
3
|
+
"version": "2.3.0",
|
|
4
|
+
"description": "Official TypeScript SDK for Serpex search API - Fetch search results in JSON format",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"repository": {
|
|
34
34
|
"type": "git",
|
|
35
|
-
"url": "https://github.com/divyeshradadiya/
|
|
35
|
+
"url": "https://github.com/divyeshradadiya/serpex-sdk-typescript",
|
|
36
36
|
"directory": "sdk/typescript"
|
|
37
37
|
},
|
|
38
38
|
"bugs": {
|
|
39
|
-
"url": "https://github.com/divyeshradadiya/
|
|
39
|
+
"url": "https://github.com/divyeshradadiya/serpex-sdk-typescript/issues"
|
|
40
40
|
},
|
|
41
|
-
"homepage": "https://github.com/divyeshradadiya/
|
|
41
|
+
"homepage": "https://github.com/divyeshradadiya/serpex-sdk-typescript#readme",
|
|
42
42
|
"files": [
|
|
43
43
|
"dist",
|
|
44
44
|
"README.md",
|
|
@@ -46,16 +46,17 @@
|
|
|
46
46
|
],
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/jest": "^29.5.0",
|
|
49
|
-
"@types/node": "^20.
|
|
49
|
+
"@types/node": "^20.19.25",
|
|
50
50
|
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
51
51
|
"@typescript-eslint/parser": "^6.0.0",
|
|
52
52
|
"eslint": "^8.0.0",
|
|
53
53
|
"jest": "^29.5.0",
|
|
54
54
|
"prettier": "^3.0.0",
|
|
55
55
|
"ts-jest": "^29.1.0",
|
|
56
|
+
"tsx": "^4.20.6",
|
|
56
57
|
"typescript": "^5.0.0"
|
|
57
58
|
},
|
|
58
59
|
"engines": {
|
|
59
60
|
"node": ">=16.0.0"
|
|
60
61
|
}
|
|
61
|
-
}
|
|
62
|
+
}
|