# imap-listener

> A node library for watching/listening to new email using imap

Latest version **1.0.0** (published 2022-09-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install imap-listener
pnpm add imap-listener
yarn add imap-listener
bun add imap-listener
```

## 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.0 |
| Published | 2022-09-29 |
| First published | 2022-09-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 2.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Shahid Kamal |
| Maintainers | shahidkamal |

## Links

- npm: https://www.npmjs.com/package/imap-listener
- npm.io page: https://npm.io/package/imap-listener

## Dependencies (2)

- [imap](https://npm.io/package/imap.md) ^0.8.19
- [mailparser](https://npm.io/package/mailparser.md) ^3.5.0

## Recent versions

- 1.0.0 (latest) — 2022-09-29

## README

# imap-mail-listener

A utility which connects and listens to new mail.


# Usage

Install the library
```bash
npm i imap-mail-listener
```

Register the event listener
```js

const { MailListener } = require("imap-mail-listener");

const imapConfig = {
  user: process.env.IMAP_USER,
  password: process.env.IMAP_PASSWORD,
  host: process.env.IMAP_HOST,
  port: process.env.IMAP_PORT,
  tls: true,
};

const listener = new MailListener(imapConfig);

listener.on("mail", (mail) => {
  console.log("new mail", mail);
});

```

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