# s3-emails

> takes email objects from an aws s3 bucket and parses them into an array

Latest version **1.0.1** (published 2018-01-21) · 0 weekly downloads

## Install

```sh
npm install s3-emails
pnpm add s3-emails
yarn add s3-emails
bun add s3-emails
```

## 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.1 |
| Published | 2018-01-21 |
| First published | 2018-01-21 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| Author | zachary hill |
| Maintainers | zhillb |
| Keywords | s3, emails, aws, parse |

## Links

- npm: https://www.npmjs.com/package/s3-emails
- Repository: https://github.com/zacharyhill/s3-emails
- Homepage: https://github.com/zacharyhill/s3-emails#readme
- Issues: https://github.com/zacharyhill/s3-emails/issues
- npm.io page: https://npm.io/package/s3-emails

## Dependencies (2)

- [aws-sdk](https://npm.io/package/aws-sdk.md) ^2.185.0
- [mailparser](https://npm.io/package/mailparser.md) ^2.1.0

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2018-01-21
- 1.0.0 — 2018-01-21

## README

## What this module does
This simple module takes mail objects stored on AWS S3 from AWS SES and parses them returning an array of message objects.
You have to pass in the AWS Bucketname as described below and setup your AWS shared authentication and you should be good to go!

## How to use

In order to use this module, you must have AWS shared credential set up on your computer. You must pass in a configuration object with a property called "Bucket" with your unique AWS bucket name and a property called removeFromBucket with a boolean value.

```javascript
const getNewMessages = require('s3-emails');

getNewMessages.({
  Bucket: 'unique-aws-bucket',
  removeFromBucket: false,
});
```

### Consuming with a promise example:

```javascript
getNewMessages()
.then((messages) => {
	if (!messages.length) {
		console.log('no new messages!');
	}
	else {
		console.log('new messages!\n\n', messages);
	}
})
.catch((err) => {
	console.log(err);
});
```

### Callback Example

```javascript
getNewMessages((messages, err) => {
  if (!err) {
  	if (!messages.length) {
      console.log('no new messages!');
    }
    else {
      console.log('new messages!\n\n', messages);
    }
  } else {
    console.log('err', err);
  }
});
```

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