temp-disposable-email 1.11.6 → 1.11.7
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 +13 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -61,7 +61,11 @@ To use the package, import the functions in your TypeScript or JavaScript projec
|
|
|
61
61
|
#### Using ES Modules (Recommended)
|
|
62
62
|
|
|
63
63
|
```typescript
|
|
64
|
-
import {
|
|
64
|
+
import {
|
|
65
|
+
createInbox,
|
|
66
|
+
getRecentEmail,
|
|
67
|
+
deleteAccount,
|
|
68
|
+
} from 'temp-disposable-email';
|
|
65
69
|
```
|
|
66
70
|
|
|
67
71
|
#### Using CommonJS
|
|
@@ -69,7 +73,7 @@ import { createInbox, getMessage, deleteAccount } from 'temp-disposable-email';
|
|
|
69
73
|
```javascript
|
|
70
74
|
const {
|
|
71
75
|
createInbox,
|
|
72
|
-
|
|
76
|
+
getRecentEmail,
|
|
73
77
|
deleteAccount,
|
|
74
78
|
} = require('temp-disposable-email');
|
|
75
79
|
```
|
|
@@ -142,7 +146,11 @@ For using temp-disposable-email with Cypress, see the example in the [Cypress fo
|
|
|
142
146
|
Here's a complete example of creating an inbox, retrieving a message, and deleting the account:
|
|
143
147
|
|
|
144
148
|
```typescript
|
|
145
|
-
import {
|
|
149
|
+
import {
|
|
150
|
+
createInbox,
|
|
151
|
+
getRecentEmail,
|
|
152
|
+
deleteAccount,
|
|
153
|
+
} from 'temp-disposable-email';
|
|
146
154
|
|
|
147
155
|
async function run() {
|
|
148
156
|
try {
|
|
@@ -151,7 +159,7 @@ async function run() {
|
|
|
151
159
|
console.log('Created email:', email);
|
|
152
160
|
|
|
153
161
|
// Get the first available message from the inbox
|
|
154
|
-
const message = await
|
|
162
|
+
const message = await getRecentEmail({
|
|
155
163
|
maxWaitTime: 50000,
|
|
156
164
|
waitInterval: 3000,
|
|
157
165
|
logPolling: true,
|
|
@@ -194,7 +202,7 @@ run();
|
|
|
194
202
|
|
|
195
203
|
## Get Email Options
|
|
196
204
|
|
|
197
|
-
You can configure polling behavior by passing an options object to `
|
|
205
|
+
You can configure polling behavior by passing an options object to `getRecentEmail`. The available options are:
|
|
198
206
|
|
|
199
207
|
- `maxWaitTime` (Optional): The maximum time to wait for messages (in milliseconds).
|
|
200
208
|
- `waitInterval` (Optional): The interval between polling attempts (in milliseconds).
|
package/package.json
CHANGED