# @maildrop/api

> node-js API for maildrop.cc

Latest version **1.0.27** (published 2021-07-09) · 0 weekly downloads

## Install

```sh
npm install @maildrop/api
pnpm add @maildrop/api
yarn add @maildrop/api
bun add @maildrop/api
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.27 |
| Published | 2021-07-09 |
| First published | 2020-04-08 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | linto.cet |
| Keywords | anonymous, anonymous-email, email, email-test, maildrop |

## Links

- npm: https://www.npmjs.com/package/@maildrop/api
- Repository: https://github.com/HedCET/maildrop
- Homepage: https://github.com/HedCET/maildrop#readme
- Issues: https://github.com/HedCET/maildrop/issues
- npm.io page: https://npm.io/package/@maildrop/api

## Dependencies (2)

- [url](https://npm.io/package/url.md) ^0.11.0
- [cross-fetch](https://npm.io/package/cross-fetch.md) ^3.1.4

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.0.27 (latest) — 2021-07-09
- 1.0.25 — 2020-09-30
- 1.0.23 — 2020-04-15
- 1.0.21 — 2020-04-10
- 1.0.19 — 2020-04-10
- 1.0.17 — 2020-04-10
- 1.0.15 — 2020-04-10
- 1.0.13 — 2020-04-10
- 1.0.11 — 2020-04-10
- 1.0.9 — 2020-04-09
- 1.0.7 — 2020-04-08
- 1.0.5 — 2020-04-08
- 1.0.3 — 2020-04-08
- 1.0.1 — 2020-04-08
- 1.0.0 — 2020-04-08

## README

# node-js API for maildrop.cc

helper APIs to fetch mail objects from https://maildrop.cc

### install

with [npm](https://www.npmjs.com/package/@maildrop/api) do:

```
npm install --save @maildrop/api
```

### usage

for basic test

```js
const mails = await maildrop.fetchMails("linto@maildrop.cc");
console.log(`${mails.length || "zero"} mails`);

for (const mail of mails)
  console.log(`==========\n${JSON.stringify(mail, null, 2)}\n==========`);
```

##### async fetchMails(email)

fetch mails
@return Object[] like this `{ id, from, to, subject, date, body, html }[]`

| opt   | type                | description                         |
| ----- | ------------------- | ----------------------------------- |
| email | <code>String</code> | [required] sample linto@maildrop.cc |

```json
{
  "id": "HrYSsdRcRA",
  "from": "Linto Cheeran <linto.cet@gmail.com>",
  "to": "linto",
  "subject": "subject",
  "date": "2020-04-08T21:47:13Z",
  "body": "raw email body",
  "html": "html body"
}
```

##### async deleteMail(email, id)

delete individual mail
@return [Object] `{ deleted: true }`

| opt   | type                | description                          |
| ----- | ------------------- | ------------------------------------ |
| email | <code>String</code> | [required] sample linto@maildrop.cc  |
| id    | <code>String</code> | [required] individual mail object id |

```js
for (const mail of mails)
  console.log(await maildrop.deleteMail("linto@maildrop.cc", mail.id));
```

##### async getApiKey(force)

return String `x-api-key`, you can use this in http header

| opt   | type                 | description                     |
| ----- | -------------------- | ------------------------------- |
| force | <code>Boolean</code> | [optional] for forceful refresh |

---
_Source: https://npm.io/package/@maildrop/api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
