-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87538ce
commit 97813f5
Showing
1 changed file
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,26 @@ Once the package is installed, you can import the library using `import`: | |
import { OneSecMail, OneSecMailAPI } from "onesecmail"; | ||
``` | ||
|
||
# Example | ||
# Examples | ||
|
||
## OneSecMail | ||
|
||
```ts | ||
import { OneSecMail } from "onesecmail"; | ||
|
||
const mailbox = await OneSecMail("[email protected]"); | ||
|
||
const messages = await mailbox.getMessages(); | ||
|
||
for (const message of messages) { | ||
const fullMessage = await message.fetchFullMessage(); | ||
console.log(fullMessage.serialize()); | ||
} | ||
|
||
await mailbox.clearMessages(); | ||
``` | ||
|
||
## OneSecMailAPI | ||
|
||
```ts | ||
import { OneSecMailAPI } from "onesecmail"; | ||
|