@apicity/free-media-upload 0.1.0-alpha.0 → 0.1.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 +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,9 +17,9 @@ pnpm add @apicity/free-media-upload
|
|
|
17
17
|
## Quick Start
|
|
18
18
|
|
|
19
19
|
```typescript
|
|
20
|
-
import {
|
|
20
|
+
import { free-media-upload as createFree-media-upload } from "@apicity/free-media-upload";
|
|
21
21
|
|
|
22
|
-
const
|
|
22
|
+
const free-media-upload = createFree-media-upload({ apiKey: process.env.FREE-MEDIA-UPLOAD_API_KEY! });
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
## Real-world example: race a portrait across four free hosts
|
|
@@ -140,7 +140,7 @@ every host fails. Useful when one provider is flaky (uguu's CDN can 502
|
|
|
140
140
|
during traffic spikes) but you don't care which one wins.
|
|
141
141
|
|
|
142
142
|
```typescript
|
|
143
|
-
import {
|
|
143
|
+
import { free as createFree, uploadToAnyHost, FreeMediaUploadError } from "@apicity/free-media-upload";
|
|
144
144
|
|
|
145
145
|
const freeMediaUpload = createFreeMediaUpload();
|
|
146
146
|
const file = new Blob([bytes], { type: "image/jpeg" });
|
|
@@ -340,14 +340,14 @@ Source: [`packages/provider/free-media-upload/src/freeMediaUpload.ts`](src/freeM
|
|
|
340
340
|
## Middleware
|
|
341
341
|
|
|
342
342
|
```typescript
|
|
343
|
-
import {
|
|
343
|
+
import { free-media-upload as createFree-media-upload, withRetry } from "@apicity/free-media-upload";
|
|
344
344
|
|
|
345
|
-
const
|
|
346
|
-
const models = withRetry(
|
|
345
|
+
const free-media-upload = createFree-media-upload({ apiKey: process.env.FREE-MEDIA-UPLOAD_API_KEY! });
|
|
346
|
+
const models = withRetry(free-media-upload.get.v1.models, { retries: 3 });
|
|
347
347
|
```
|
|
348
348
|
|
|
349
349
|
Part of the [apicity](https://github.com/justintanner/apicity) monorepo.
|
|
350
350
|
|
|
351
351
|
## License
|
|
352
352
|
|
|
353
|
-
MIT — see [LICENSE](LICENSE).
|
|
353
|
+
MIT — see [LICENSE](LICENSE).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apicity/free-media-upload",
|
|
3
|
-
"version": "0.1.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Zero-auth file hosting wrapper for catbox, gofile, uguu, filebin, litterbox, tempsh, tflink, and tmpfiles — eight providers behind one typed surface.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|