# extract-files-eml

> Convert EML files to PDF, save attachments, rename EML files

Latest version **1.0.10** (published 2019-05-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install extract-files-eml
pnpm add extract-files-eml
yarn add extract-files-eml
bun add extract-files-eml
```

## Health

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

Positive: no vulnerabilities; high maintenance score.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.10 |
| Published | 2019-05-13 |
| First published | 2019-05-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 49.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Bram Esposito |
| Maintainers | wbteodoro |
| Keywords | email, pdf |

## Links

- npm: https://www.npmjs.com/package/extract-files-eml
- Repository: https://github.com/BramEsposito/eml-to-pdf
- Homepage: https://github.com/BramEsposito/eml-to-pdf#readme
- Issues: https://github.com/BramEsposito/eml-to-pdf/issues
- npm.io page: https://npm.io/package/extract-files-eml

## Dependencies (8)

- [path](https://npm.io/package/path.md) ^0.12.7
- [npm-cid](https://npm.io/package/npm-cid.md) ^0.1.4
- [envelope](https://npm.io/package/envelope.md) ^2.0.2
- [html-pdf](https://npm.io/package/html-pdf.md) ^2.2.0
- [dateformat](https://npm.io/package/dateformat.md) ^3.0.3
- [handlebars](https://npm.io/package/handlebars.md) ^4.1.2
- [html-entities](https://npm.io/package/html-entities.md) ^1.2.1
- [sanitize-filename](https://npm.io/package/sanitize-filename.md) 1.6.1

## Alternatives

- [@cantoo/pdf-lib](https://npm.io/package/@cantoo/pdf-lib.md) — 297.9K weekly downloads
- [datatables.net-buttons](https://npm.io/package/datatables.net-buttons.md) — 200.1K weekly downloads
- [@ckeditor/ckeditor5-export-pdf](https://npm.io/package/@ckeditor/ckeditor5-export-pdf.md) — 167.0K weekly downloads
- [scanbot-web-sdk](https://npm.io/package/scanbot-web-sdk.md) — 15.0K weekly downloads
- [@syncfusion/ej2-angular-pdfviewer](https://npm.io/package/@syncfusion/ej2-angular-pdfviewer.md) — 8.8K weekly downloads

## Recent versions

- 1.0.10 (latest) — 2019-05-13
- 1.0.9 — 2019-05-13

## README

# extract-files-eml
Convert EML email files to PDF.

[EML files](http://forensicswiki.org/wiki/EML) are email messages in MIME RFC 822 standard format.

## Installation

Clone this repository or run 

```
npm install extract-files-eml

## Usage

This module is usable in three related use cases:

- rename the EML file to a recognisable file
- save attachments from the message to disk
- save the message to a PDF file, with an email header

## Rename the email message 

Rename the eml file using data from the email message in this format: ```yyyy.mm.dd - from.name - subject.eml```

Files with the same filename will receive a trailing counter, eg: ```yyyy.mm.dd - from.name - subject_1.eml```.

```javascript
var eml2pdf = new Eml2Pdf("filename.eml");

eml2pdf.renameFile();
```

**TODO**: allow custom filename formatting

## Save attachments to disk

Save the attachments in the email message to disk. These will be saved along the EML file in a subdirectory named with the naming scheme from ```renameFile```.

```javascript
var eml2pdf = new Eml2Pdf("filename.eml");

eml2pdf.saveAttachmentsFromEML();
```

**TODO**: accept a default directory as parameter where attachments will be saved

## Convert email message to PDF

A pdf file will be saved to disk with the naming scheme from ```renameFile``` . It will have a header containing time, sender, receiver, Reply-to, CC and subject.

```javascript
var eml2pdf = new Eml2Pdf("filename.eml");

eml2pdf.convertEMLtoPDF();
```

- **TODO**: add a table with attachments info at the end of the pdf 
- **TODO**: provide ability to set scaling options for the PDF
- **TODO**: reduce the impact from message CSS on the header layout

**KNOWN ISSUES**: the PDF will be scaled on HiDPI screens. 


```

## License

ISC

## Feedback 

Feedback and pull requests are welcome


## Forked and adapted from: 

Bran Esposito 
https://github.com/BramEsposito/eml-to-pdf#readme

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