forked from amitevski/eml_to_html
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit accff2b
Showing
4 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Created by .gitignore support plugin (hsz.mobi) | ||
### Node template | ||
# Logs | ||
logs | ||
*.log | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directory | ||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- | ||
node_modules | ||
|
||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Cli Tool to extract html content from a eml file | ||
|
||
## Usage | ||
|
||
|
||
```bash | ||
node parse.js -i /path/to/email.eml -o /path/to/email.html | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "eml_parser", | ||
"version": "1.0.0", | ||
"description": "Parse eml file and output html", | ||
"main": "parse.js", | ||
"dependencies": { | ||
"mailparser": "^0.4.6", | ||
"nomnom": "^1.8.1" | ||
}, | ||
"devDependencies": {}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [ | ||
"eml", | ||
"html" | ||
], | ||
"author": "Aco Mitevski", | ||
"license": "ISC" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env node | ||
|
||
var MailParser = require('mailparser').MailParser; | ||
var mailparser = new MailParser(); | ||
var fs = require('fs'); | ||
|
||
var opts = require("nomnom") | ||
.option('infile', { | ||
abbr: 'i', | ||
required: true, | ||
help: 'Specify input file' | ||
}) | ||
.option('outfile', { | ||
abbr: 'o', | ||
required: true, | ||
help: 'Specify output file' | ||
}) | ||
.parse(); | ||
|
||
|
||
mailparser.on("end", function(mail){ | ||
fs.writeFileSync(opts.outfile, mail.html); | ||
}); | ||
|
||
fs.createReadStream(opts.infile).pipe(mailparser); |