New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

onesecmail-prout

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

onesecmail-prout

Create and receive email in only 1 second.

  • 0.3.1
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

logo

npm downloads install size node license

Create and receive email in only 1 second.

Installation

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

Usage

Once the package is installed, you can import the library using import:

import { OneSecMail, OneSecMailAPI } from "onesecmail";

Example

API

Options

Options can be passed to constructor and all methods.

// default options
const options: Partial<Options> = {
  retry: 2, // max retry failed request
  timeout: 10_000, // milliseconds
};

OneSecMail


OneSecMailAPI

This class is an exact reproduction of the official 1secmail.com API.

Create an instance

const onesecmailApi = new OneSecMailAPI();
const onesecmailApi = new OneSecMailAPI(options);

Instance methods

All methods return a Promise.

genRandomMailbox([count[, options]])

count must be between 1 and 500

const emailAddresses = await onesecmailApi.genRandomMailbox(); // same: genRandomMailbox(1)
const emailAddresses = await onesecmailApi.genRandomMailbox(5);
const emailAddresses = await onesecmailApi.genRandomMailbox(options); // same: genRandomMailbox(1, options)
const emailAddresses = await onesecmailApi.genRandomMailbox(5, options);
getDomainList([options])
const domainList = await onesecmailApi.getDomainList();
const domainList = await onesecmailApi.getDomainList(options);
getMessages(login, domain[, options])
const messages = await onesecmailApi.getMessages("demo", "1secmail.com");
const messages = await onesecmailApi.getMessages("demo", "1secmail.com", options);
readMessage(login, domain, id[, options])
const message = await onesecmailApi.readMessage("demo", "1secmail.com", 1337);
const message = await onesecmailApi.readMessage("demo", "1secmail.com", 1337, options);

Returns null if message do not exists.

download(login, domain, id, file[, options])
const file = await onesecmailApi.download("demo", "1secmail.com", 1337, "file.pdf");
const file = await onesecmailApi.download("demo", "1secmail.com", 1337, "file.pdf", options);

Returns null if file do not exists.

Keywords

FAQs

Package last updated on 25 Mar 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc