![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
onesecmail
Advanced tools
Package using the 1secmail.com service.
Create and receive email in only 1 second.
Warning: This package is native ES modules and does not provide a CommonJS export. If your project uses CommonJS, you will have to convert to ESM or use the dynamic import() function.
Using npm:
npm install onesecmail
Using yarn:
yarn add onesecmail
Using pnpm:
pnpm add onesecmail
Once the package is installed, you can import the library using import
:
import { OneSecMail, OneSecMailAPI } from "onesecmail";
import { OneSecMail } from "onesecmail";
const mailbox = await OneSecMail("demo@1secmail.com");
const messages = await mailbox.getMessages();
for (const message of messages) {
const fullMessage = await message.fetchFullMessage();
console.log(fullMessage.serialize());
}
await mailbox.clearMessages();
import { OneSecMailAPI } from "onesecmail";
const options = {
retry: 5,
timeout: 3000,
};
const api = new OneSecMailAPI(options);
const [email] = await api.genRandomMailbox();
const [login, domain] = email.split("@");
const messages = await api.getMessages(login, domain);
for (const message of messages) {
const fullMessage = await api.readMessage(login, domain, message.id);
console.log(fullMessage);
}
Options can be passed to the constructor and to each method.
// default options
const options: Partial<Options> = {
retry: 2, // max retry failed requests
timeout: 10_000, // milliseconds
};
const mailbox = await OneSecMail();
const mailbox = await OneSecMail("demo@1secmail.com");
const mailbox = await OneSecMail(options);
const mailbox = await OneSecMail("demo@1secmail.com", options);
Returns an instance of OneSecMailbox
.
const messages = await mailbox.getMessages();
const messages = await mailbox.getMessages(options);
Returns an array of OneSecMailShortMessage
instances.
await mailbox.clearMessages();
await mailbox.clearMessages(options);
intervalTime
must be at least 1000.
mailbox.startPolling(); // default intervalTime: 5000 milliseconds
mailbox.startPolling(30_000);
mailbox.stopPolling();
events
mailbox.on("newMessage", (message: OneSecMailShortMessage) => {
console.log(message.serialize());
});
mailbox.on("error", (error: Error) => {
console.error(error);
});
const fullMessage = await message.fetchFullMessage();
const fullMessage = await message.fetchFullMessage(options);
Returns an instance of OneSecMailMessage
if the message still exists, otherwise throw an error.
OneSecMailMessage
has an attachments field that contains an array of OneSecMailAttachment
instances.
const file = await attachment.download();
const file = await attachment.download(options);
Returns a Buffer if the file still exists, otherwise throw an error.
This class is an exact reproduction of the official 1secmail.com API.
const api = new OneSecMailAPI();
const api = new OneSecMailAPI(options);
All methods return a Promise.
count
must be between 1 and 500.
const emailAddresses = await api.genRandomMailbox(); // same to: genRandomMailbox(1)
const emailAddresses = await api.genRandomMailbox(5);
const emailAddresses = await api.genRandomMailbox(options); // same to: genRandomMailbox(1, options)
const emailAddresses = await api.genRandomMailbox(5, options);
Returns an array of generated email addresses.
const domainList = await api.getDomainList();
const domainList = await api.getDomainList(options);
Returns an array of active domains.
const messages = await api.getMessages("demo", "1secmail.com");
const messages = await api.getMessages("demo", "1secmail.com", options);
Returns an array of ShortMessage (message with no body and attachments).
const message = await api.readMessage("demo", "1secmail.com", 639);
const message = await api.readMessage("demo", "1secmail.com", 639, options);
Returns a Message if the message exists, otherwise returns null.
const file = await api.download("demo", "1secmail.com", 639, "iometer.pdf");
const file = await api.download("demo", "1secmail.com", 639, "iometer.pdf", options);
Returns a Buffer if the file exists, otherwise returns null.
FAQs
Create and receive email in only 1 second.
The npm package onesecmail receives a total of 64 weekly downloads. As such, onesecmail popularity was classified as not popular.
We found that onesecmail demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.