So you're saying that console.log(msg.headers.date) gives you [ 'Tue, 5 Apr 2011 15:15:59 +0100' ]??
In that case, console.log(msg.headers.date[0]) == Tue, 5 Apr 2011 15:15:59 +0100
Is that what you're trying to get?
What is this? A file? Straight text? Part of a larger JSON structure?
Basically, convert it into an actual structure and load it, one way or another:
module.exports = [
[ 'Tue, 5 Apr 2011 15:15:59 +0100' ],
[ '[email protected]' ],
[ 'User Name <[email protected]>' ],
[ 'oi' ]
];
----
var info = require('./file');
// info[0][0] == Tue, 5 Apr 2011 15:15:59 +0100
or if you want to parse it:
var lines = [
"[ 'Tue, 5 Apr 2011 15:15:59 +0100' ]",
"[ '[email protected]' ]",
"[ 'User Name <[email protected]>' ]",
"[ 'oi' ]"
];
var info = JSON.parse('[' + lines.join(',') + ']');
// info[0][0] == Tue, 5 Apr 2011 15:15:59 +0100