mime2
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -1,5 +0,1 @@ | ||
EHLO mail-yw0-f170.google.com | ||
MAIL FROM:<song940@gmail.com> | ||
RCPT TO:<test@lsong.org> | ||
DATA | ||
Received: by mail-yw0-f170.google.com with SMTP id g127so132830217ywf.2 | ||
@@ -48,4 +44,2 @@ for <test@lsong.org>; Sat, 12 Mar 2016 19:42:31 -0800 (PST) | ||
--001a114ca9c82b67ff052de5f419-- | ||
. | ||
QUIT | ||
--001a114ca9c82b67ff052de5f419-- |
const fs = require('fs'); | ||
const Message = require('..'); | ||
const message = new Message({ }, 'hello'); | ||
const message = new Message(); | ||
message.from = 'liusong02@meituan.com'; | ||
message.to = 'Liu song <hi@lsong.org>'; | ||
fs.createReadStream(__dirname + '/../docs/smtp-gmail.txt').pipe(message); | ||
console.log(message.toString()); | ||
// message.on('end', (headers, body) => { | ||
// console.log(body); | ||
// }); | ||
// fs.createReadStream(__dirname + '/../docs/smtp-qq.txt').pipe(message); | ||
// const type = new Message.Header({ | ||
// name: 'content-type', | ||
// value: 'text/html', | ||
// options: { a: 1, b:2 } | ||
// }); | ||
// const html = new Message([ | ||
// type, | ||
// ], '<h1>Hello text/html</h1>'); | ||
// const message = new Message({ | ||
// From: 'mail@lsong.org', | ||
// To: 'hi@lsong.org', | ||
// Subject: 'hello world', | ||
// type | ||
// }, [ | ||
// html, 'hello text/plain!' | ||
// ]); | ||
// console.log(message.toString()); | ||
message.on('end', () => { | ||
console.log(message.headers); | ||
}); |
@@ -100,3 +100,3 @@ const Stream = require('stream'); | ||
else { | ||
v && [v]; | ||
v && (v = [v]); | ||
Array.isArray(v) ? v.push(p) : v = p; | ||
@@ -154,2 +154,3 @@ } | ||
.replace(/\n\t/g, '') | ||
.replace(/\n +/g, '') | ||
.replace(/\r\n/g, '\n') | ||
@@ -156,0 +157,0 @@ .replace(/\n/g, '\r\n'); |
{ | ||
"name": "mime2", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "MIME in node.js", | ||
@@ -8,3 +8,4 @@ "main": "index.js", | ||
"doc": "docs", | ||
"example": "example" | ||
"example": "example", | ||
"test": "test" | ||
}, | ||
@@ -18,3 +19,7 @@ "scripts": { | ||
}, | ||
"keywords": [], | ||
"keywords": [ | ||
"mime", | ||
"mail", | ||
"smtp" | ||
], | ||
"author": "lsong", | ||
@@ -21,0 +26,0 @@ "license": "MIT", |
178521
7045