Socket
Socket
Sign inDemoInstall

onesec-api

Package Overview
Dependencies
7
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    onesec-api

NodeJS wrapper for 1secmail.com


Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
1
Install size
529 kB
Created
Weekly downloads
 

Readme

Source

OneSecAPI


Installation

Using npm

npm install onesec-api

Using yarn

yarn add onesec-api


Example

npm run test

const { OneSecMailbox } = require("../lib");

const oneSec = new OneSecMailbox("test", "esiix.com");

oneSec.getMail().then((mailbox) => {
  mailbox.forEach((msg, i) => {
    console.log(
      `Email #${i + 1} (of ${mailbox.length})\n` +
        ` From: ${msg.getSender()}\n` +
        ` Subject: ${msg.getSubject()}\n` +
        ` Body: ${msg.getTextBody()}\n` +
        ` Date: ${msg.getDate()}\n` +
        ` Attachment Count: ${msg.getAttachments().length}`
    );
  });
});

Documentation

OneSecMailbox


Methods

new OneSecMailbox(username: string, domain: string): OneSecMailbox;

Arguments

  • Username - The username of the email
  • Domain - The email domain (Not including the '@')
    • Valid Domains: 1secmail.com 1secmail.org 1setmail.net wwjmp.com esiix.com

Description


OneSecMailbox~getMail(): Promise<OneSecMessage[]>

Description


OneSecMailbox.getDomains(): string[]

Description

  • Returns list of valid domains

OneSecMessage


Methods

OneSecMessage~getID(): number

Description

  • Returns the 1secMAIL ID

OneSecMessage~getSender(): string

Description

  • Returns the mail body

OneSecMessage~getSubject(): string

Description

  • Returns the mail plain text body

OneSecMessage~getDate(): Date

Description

  • Returns the Date mail was received

OneSecMessage~getAttachments(): OneSecMessageAttachment[]

Description

  • Returns a list of attachments

OneSecMessage~getBody(): string

Description

  • Returns the mail body

OneSecMessage~getTextBody(): string

Description

  • Returns the mail plain text body

OneSecMessage~getHtmlBody(): string

Description

  • Returns the mail html body

OneSecMessageAttachment

Methods

OneSecMessageAttachment~getFileName(): string

Description

  • Returns the attachment file name

OneSecMessageAttachment~getFileURL(): string

Description

  • Returns the attachment download URL

OneSecMessageAttachment~getFileSize(): number

Description

  • Returns the attachment file size

OneSecMessageAttachment~getContentType(): string

Description

  • Returns the attachment content type

Keywords

FAQs

Last updated on 25 Jan 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc