tmpbox.me 1.0.2 → 1.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.
- package/README.md +7 -24
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,13 +5,12 @@ Official TmpBox.me uploader SDK and CLI for Node.js.
|
|
|
5
5
|
- No account required for guest uploads
|
|
6
6
|
- Guest limit: **100MB per file**
|
|
7
7
|
- Logged-in user limit: **500MB per file**
|
|
8
|
-
- Uploads **4 chunks at the same time** by default
|
|
9
8
|
- Supports CommonJS, ES Module, TypeScript types, and CLI
|
|
10
9
|
|
|
11
10
|
## Installation
|
|
12
11
|
|
|
13
12
|
```bash
|
|
14
|
-
npm install tmpbox
|
|
13
|
+
npm install tmpbox.me
|
|
15
14
|
```
|
|
16
15
|
|
|
17
16
|
Node.js 18 or newer is required.
|
|
@@ -23,7 +22,7 @@ No username, password, or token is required.
|
|
|
23
22
|
### CommonJS
|
|
24
23
|
|
|
25
24
|
```js
|
|
26
|
-
const { uploadFile } = require("tmpbox");
|
|
25
|
+
const { uploadFile } = require("tmpbox.me");
|
|
27
26
|
|
|
28
27
|
const result = await uploadFile("./video.mp4");
|
|
29
28
|
console.log(result.fullUrl);
|
|
@@ -32,7 +31,7 @@ console.log(result.fullUrl);
|
|
|
32
31
|
### ES Module
|
|
33
32
|
|
|
34
33
|
```js
|
|
35
|
-
import { uploadFile } from "tmpbox";
|
|
34
|
+
import { uploadFile } from "tmpbox.me";
|
|
36
35
|
|
|
37
36
|
const result = await uploadFile("./video.mp4");
|
|
38
37
|
console.log(result.fullUrl);
|
|
@@ -45,7 +44,7 @@ Guest uploads are limited to **100MB per file**.
|
|
|
45
44
|
Use username and password when you need the **500MB per file** user limit.
|
|
46
45
|
|
|
47
46
|
```js
|
|
48
|
-
import { uploadFile } from "tmpbox";
|
|
47
|
+
import { uploadFile } from "tmpbox.me";
|
|
49
48
|
|
|
50
49
|
const result = await uploadFile("./large-video.mp4", {
|
|
51
50
|
username: "your_username",
|
|
@@ -58,7 +57,7 @@ console.log(result.fullUrl);
|
|
|
58
57
|
You can also use an existing token:
|
|
59
58
|
|
|
60
59
|
```js
|
|
61
|
-
import { uploadFile } from "tmpbox";
|
|
60
|
+
import { uploadFile } from "tmpbox.me";
|
|
62
61
|
|
|
63
62
|
const result = await uploadFile("./large-video.mp4", {
|
|
64
63
|
token: "YOUR_TOKEN",
|
|
@@ -68,7 +67,7 @@ const result = await uploadFile("./large-video.mp4", {
|
|
|
68
67
|
## Upload progress
|
|
69
68
|
|
|
70
69
|
```js
|
|
71
|
-
import { uploadFile } from "tmpbox";
|
|
70
|
+
import { uploadFile } from "tmpbox.me";
|
|
72
71
|
|
|
73
72
|
const result = await uploadFile("./file.zip", {
|
|
74
73
|
onProgress(state) {
|
|
@@ -79,20 +78,10 @@ const result = await uploadFile("./file.zip", {
|
|
|
79
78
|
console.log(result.fullUrl);
|
|
80
79
|
```
|
|
81
80
|
|
|
82
|
-
## Chunk concurrency
|
|
83
|
-
|
|
84
|
-
By default, the SDK uploads **4 chunks at once**.
|
|
85
|
-
|
|
86
|
-
```js
|
|
87
|
-
await uploadFile("./file.zip", {
|
|
88
|
-
chunkConcurrency: 4,
|
|
89
|
-
});
|
|
90
|
-
```
|
|
91
|
-
|
|
92
81
|
## Upload multiple files
|
|
93
82
|
|
|
94
83
|
```js
|
|
95
|
-
import { uploadFiles } from "tmpbox";
|
|
84
|
+
import { uploadFiles } from "tmpbox.me";
|
|
96
85
|
|
|
97
86
|
const results = await uploadFiles([
|
|
98
87
|
"./image.png",
|
|
@@ -135,12 +124,6 @@ tmpbox-upload ./a.zip ./b.pdf ./c.mp4
|
|
|
135
124
|
tmpbox-upload ./video.mp4 --json
|
|
136
125
|
```
|
|
137
126
|
|
|
138
|
-
### Change chunk concurrency
|
|
139
|
-
|
|
140
|
-
```bash
|
|
141
|
-
tmpbox-upload ./video.mp4 --chunk-concurrency 4
|
|
142
|
-
```
|
|
143
|
-
|
|
144
127
|
## Environment variables
|
|
145
128
|
|
|
146
129
|
The CLI and SDK can read these automatically:
|