{"_id":"@alisarioglu/msgreader","_rev":"3-0ac782db3f9e904fdaf002b82233b96a","name":"@alisarioglu/msgreader","dist-tags":{"latest":"1.22.3"},"versions":{"1.22.1":{"name":"@alisarioglu/msgreader","version":"1.22.1","author":{"name":"kenjiuno"},"license":"ISC","_id":"@alisarioglu/msgreader@1.22.1","maintainers":[{"name":"alisarioglu","email":"asa@condat.de"}],"homepage":"https://github.com/alisarioglu/msgreader#readme","bugs":{"url":"https://github.com/alisarioglu/msgreader/issues"},"dist":{"shasum":"b0ffaf0a760abe68ddbaf94b1bcc3a9b98f3915b","tarball":"https://registry.npmjs.org/@alisarioglu/msgreader/-/msgreader-1.22.1.tgz","fileCount":28,"integrity":"sha512-UKdFQokc/JpgXkO1tldDIheNi77TV8duwJTpqFF5PiS9qI/sVNwyFGpJzFZQYKa+E7B2naZRmTFy4mTIheETUA==","signatures":[{"sig":"MEUCIH57zQKY4wDUApkNPVJgoWoPXlrqH6Z+6WCemwGW9aFvAiEA/H6fvfQk5CEbdj8cD6seEv/WCBPWHDhI400Jd9koidg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":362254},"main":"lib/index.js","type":"module","types":"lib/index.d.ts","engines":{"node":">= 10"},"gitHead":"7f9bb9e6a812e10c13690c011a6f85b66c2611d3","private":false,"scripts":{"dr":"npm publish --dry-run","test":"npm run mocha test/ test2/","build":"tsc","mocha":"set NODE_ENV=test && mocha","prepare":"npm run build && npm run test"},"_npmUser":{"name":"alisarioglu","email":"asa@condat.de"},"repository":{"url":"git+https://github.com/alisarioglu/msgreader.git","type":"git"},"_npmVersion":"10.8.2","description":"Outlook Item File (.msg) reader in JavaScript Npm Module","directories":{},"_nodeVersion":"20.17.0","dependencies":{"iconv-lite":"^0.6.3","@kenjiuno/decompressrtf":"^0.1.3"},"_hasShrinkwrap":false,"devDependencies":{"temp":"^0.9.4","mocha":"^11.0.1","typedoc":"^0.27.6","commander":"^13.0.0","typescript":"^5.7.2","@types/node":"^22.10.3","typedoc-plugin-rename-defaults":"^0.7.2"},"_npmOperationalInternal":{"tmp":"tmp/msgreader_1.22.1_1743632884394_0.819568900272998","host":"s3://npm-registry-packages-npm-production"}},"1.22.2":{"name":"@alisarioglu/msgreader","version":"1.22.2","author":{"name":"kenjiuno"},"license":"ISC","_id":"@alisarioglu/msgreader@1.22.2","maintainers":[{"name":"alisarioglu","email":"asa@condat.de"}],"homepage":"https://github.com/alisarioglu/msgreader#readme","bugs":{"url":"https://github.com/alisarioglu/msgreader/issues"},"dist":{"shasum":"70e7b5aa2d7ab48ad0189db28d8a2e4ecef622ca","tarball":"https://registry.npmjs.org/@alisarioglu/msgreader/-/msgreader-1.22.2.tgz","fileCount":28,"integrity":"sha512-ZrETSW5DwUcxpNe1Ycr45MBLNOc1xjdl9CflxCp69OiydixTpI/ZHAPWqXewpZFSRm2JC2KMxOi5JnpxYxQNqA==","signatures":[{"sig":"MEQCIAGY5MGuCt7g3l1fHsYofxHA2h5230QCId8XHDOcKcFvAiBDUyNJ9sqgdl1AJDTMhEqksmqp7wO9fFKgSkwRjLfIfg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":362039},"main":"lib/index.js","type":"module","types":"lib/index.d.ts","engines":{"node":">= 10"},"gitHead":"d9e858ed29270da929441dbfdf93d0f84669944c","private":false,"scripts":{"dr":"npm publish --dry-run","test":"npm run mocha test/ test2/","build":"tsc","mocha":"set NODE_ENV=test && mocha","prepare":"npm run build && npm run test"},"_npmUser":{"name":"alisarioglu","email":"asa@condat.de"},"repository":{"url":"git+https://github.com/alisarioglu/msgreader.git","type":"git"},"_npmVersion":"10.8.2","description":"Outlook Item File (.msg) reader in JavaScript Npm Module","directories":{},"_nodeVersion":"20.17.0","dependencies":{"@kenjiuno/decompressrtf":"^0.1.3"},"_hasShrinkwrap":false,"devDependencies":{"temp":"^0.9.4","mocha":"^11.0.1","typedoc":"^0.27.6","commander":"^13.0.0","typescript":"^5.7.2","@types/node":"^22.10.3","typedoc-plugin-rename-defaults":"^0.7.2"},"_npmOperationalInternal":{"tmp":"tmp/msgreader_1.22.2_1743782435967_0.6336763325820425","host":"s3://npm-registry-packages-npm-production"}},"1.22.3":{"name":"@alisarioglu/msgreader","version":"1.22.3","description":"Outlook Item File (.msg) reader in JavaScript Npm Module","type":"module","main":"lib/index.js","types":"lib/index.d.ts","private":false,"scripts":{"build":"tsc","test":"npm run mocha test/ test2/","prepare":"npm run build && npm run test","mocha":"set NODE_ENV=test && mocha","dr":"npm publish --dry-run"},"author":{"name":"kenjiuno"},"repository":{"type":"git","url":"git+https://github.com/alisarioglu/msgreader.git"},"license":"ISC","devDependencies":{"@types/node":"^22.10.3","commander":"^13.0.0","mocha":"^11.0.1","temp":"^0.9.4","typedoc":"^0.27.6","typedoc-plugin-rename-defaults":"^0.7.2","typescript":"^5.7.2"},"dependencies":{"@kenjiuno/decompressrtf":"^0.1.3"},"engines":{"node":">= 10"},"_id":"@alisarioglu/msgreader@1.22.3","gitHead":"862b91bcb35e8152610a600733870284cbd37a3f","bugs":{"url":"https://github.com/alisarioglu/msgreader/issues"},"homepage":"https://github.com/alisarioglu/msgreader#readme","_nodeVersion":"20.17.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-nrMREhmxG4Y0rzkLtKdDIcC6ftK14CVszELPPiAo/iibb6ZIMGHlO8KpQhRA2+sypSKP4Ck2/qjKtje1jwULUw==","shasum":"8b9a220f8b379994c0bc086c048f592643f28cab","tarball":"https://registry.npmjs.org/@alisarioglu/msgreader/-/msgreader-1.22.3.tgz","fileCount":28,"unpackedSize":362310,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCWWBFekkNs+nkzlyX1YD0H8oI2rfc9HJ8ro7F1I32TcwIgZnkWLDO4MSzpfSnfzbYTKZpHfTKtMi6CibZ+8YH9Rfs="}]},"_npmUser":{"name":"alisarioglu","email":"asa@condat.de"},"directories":{},"maintainers":[{"name":"alisarioglu","email":"asa@condat.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/msgreader_1.22.3_1743795798018_0.8015601483396124"},"_hasShrinkwrap":false}},"time":{"created":"2025-04-02T22:28:04.314Z","modified":"2025-04-04T19:43:18.479Z","1.22.1":"2025-04-02T22:28:04.565Z","1.22.2":"2025-04-04T16:00:36.207Z","1.22.3":"2025-04-04T19:43:18.246Z"},"bugs":{"url":"https://github.com/alisarioglu/msgreader/issues"},"author":{"name":"kenjiuno"},"license":"ISC","homepage":"https://github.com/alisarioglu/msgreader#readme","repository":{"type":"git","url":"git+https://github.com/alisarioglu/msgreader.git"},"description":"Outlook Item File (.msg) reader in JavaScript Npm Module","maintainers":[{"name":"alisarioglu","email":"asa@condat.de"}],"readme":"# msgreader\r\n\r\nThis version is a fork of https://github.com/HiraokaHyperTools/msgreader ([npmjs.com @kenjiuno/msgreader](https://www.npmjs.com/package/@kenjiuno/msgreader)) and has been optimized for modern browser environments to run as an ES6 module directly in the local browser.\r\n\r\n[![npm](https://img.shields.io/npm/v/@alisarioglu/msgreader)](https://www.npmjs.com/package/@alisarioglu/msgreader)\r\n[![Build Status](https://dev.azure.com/HiraokaHyperTools/msgreader/_apis/build/status/HiraokaHyperTools.msgreader?branchName=master)](https://dev.azure.com/HiraokaHyperTools/msgreader/_build/latest?definitionId=7&branchName=master)\r\n\r\nOutlook Item File (.msg) reader in JavaScript npm Module\r\n\r\nOriginal projects:\r\n\r\n- https://github.com/FreiraumIO/msgreader\r\n- https://github.com/ykarpovich/msg.reader\r\n\r\nThis repo contains the code of the modified project.\r\nAnd also it is published as a [npm package](https://www.npmjs.com/package/@kenjiuno/msgreader).\r\n\r\nLinks: [_typedoc documentation_](https://hiraokahypertools.github.io/msgreader/typedoc/) | [_online demo_](https://hiraokahypertools.github.io/msgreader_demo/) | [_online demo 2_](https://hiraokahypertools.github.io/msgreader_demo2/) | [_online demo 3_](https://hiraokahypertools.github.io/msgreader_demo3/)\r\n\r\n## How to use\r\n\r\n```javascript\r\nimport fs from 'fs'\r\nimport MsgReader from '@kenjiuno/msgreader'\r\n\r\nconst msgFileBuffer = fs.readFileSync('./data/test.msg')\r\nconst testMsg = new MsgReader(msgFileBuffer)\r\nconst testMsgInfo = testMsg.getFileData()\r\n/**\r\n  testMsgInfo contains:\r\n  {\r\n    attachments:[\r\n      {\r\n        dataId:62,\r\n        contentLength:122784,\r\n        fileName:'5AAoPFgV-nJ965R7o-98C38840-4454-4750-9AEF-F53DB3E37548.jpg',\r\n        fileNameShort:'5AAOPF~1.JPG'\r\n      }\r\n    ],\r\n    recipients:[\r\n      {\r\n        name:'christoph@freiraum.xyz'\r\n      }\r\n    ],\r\n    senderName:'christoph@freiraum.xyz',\r\n    body:' \\r\\n\\r\\n',\r\n    headers:'Return-Path: <christoph@freiraum.xyz>\\r\\nReceived: from DESKTOPGBT9Q6P (HSI-KBW-109-193-162-142.hsi7.kabel-badenwuerttemberg.de. [109.193.162.142])\\r\\n        by smtp.gmail.com with ESMTPSA id q81sm10535131wmg.8.2018.03.23.09.06.30\\r\\n        for <christoph@freiraum.xyz>\\r\\n        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\\r\\n        Fri, 23 Mar 2018 09:06:30 -0700 (PDT)\\r\\nFrom: <christoph@freiraum.xyz>\\r\\nTo: <christoph@freiraum.xyz>\\r\\nSubject: asdf\\r\\nDate: Fri, 23 Mar 2018 17:06:29 +0100\\r\\nMessage-ID: <000001d3c2c0$e7ca4aa0$b75edfe0$@freiraum.xyz>\\r\\nMIME-Version: 1.0\\r\\nContent-Type: multipart/mixed;\\r\\n\\tboundary=\"----=_NextPart_000_0001_01D3C2C9.498F75F0\"\\r\\nX-Mailer: Microsoft Outlook 16.0\\r\\nThread-Index: AdPCwN90aOYoV24DTGKfv8JaCuci0g==\\r\\nContent-Language: de\\r\\n\\r\\n',\r\n    subject:'asdf'\r\n  }\r\n**/\r\nconst testMsgAttachment0 = testMsg.getAttachment(testMsgInfo.attachments[0])\r\n/**\r\n  testMsgAttachment0 === testMsg.getAttachment[0] and both contain:\r\n  { \r\n    fileName: '5AAoPFgV-nJ965R7o-98C38840-4454-4750-9AEF-F53DB3E37548.jpg',\r\n    content: <Uint8Array> //content removed\r\n  }\r\n**/\r\n```\r\n\r\n### List attachment files\r\n\r\n```javascript\r\n  const msgFileBuffer = fs.readFileSync(msgFilePath)\r\n  const testMsg = new MsgReader(msgFileBuffer)\r\n  const testMsgInfo = testMsg.getFileData()\r\n\r\n  for (const att of testMsgInfo.attachments) {\r\n    console.log(att.fileName);\r\n    // testMsg.getAttachment(att).content\r\n  }\r\n```\r\n\r\n## Build msgreader locally\r\n\r\n```bat\r\nyarn\r\n```\r\n\r\n## Optional command line tool\r\n\r\nThis can be used for testing this tool.\r\n\r\n```bat\r\nC:\\Proj\\msgreader>node cli -h\r\nUsage: cli [options] [command]\r\n\r\nOptions:\r\n  -h, --help                             output usage information\r\n\r\nCommands:\r\n  parse [options] <msgFilePath>          Parse msg file and print parsed structure\r\n  rtf <msgFilePath> [saveToRtfFilePath]  Parse msg file and print decompressed rtf\r\n  list-att <msgFilePath>                 Parse msg file and list attachment file names\r\n  save-att <msgFilePath> <saveToDir>     Parse msg file and write all attachment files\r\n```\r\n\r\nObtain decompressed RTF file from `test/test1.msg`:\r\n\r\n```bat\r\nC:\\Proj\\msgreader>node cli rtf test\\test1.msg test1.rtf\r\n\r\nC:\\Proj\\msgreader>type test1.rtf\r\n{\\rtf1\\ansi\\ansicpg1252\\fromtext \\fbidis \\deff0{\\fonttbl\r\n{\\f0\\fswiss Arial;}\r\n{\\f1\\fmodern Courier New;}\r\n{\\f2\\fnil\\fcharset2 Symbol;}\r\n{\\f3\\fmodern\\fcharset0 Courier New;}}\r\n{\\colortbl\\red0\\green0\\blue0;\\red0\\green0\\blue255;}\r\n\\uc1\\pard\\plain\\deftab360 \\f0\\fs20 body\\par\r\n}\r\n```\r\n\r\nList attachment files in `test/test2.msg`:\r\n\r\n```bat\r\nC:\\Proj\\msgreader>node cli list-att test\\test2.msg\r\nA.txt\r\n```\r\n\r\nExtract attacument files into folder `test2`:\r\n\r\n```bat\r\nC:\\Proj\\msgreader>node cli save-att test\\test2.msg test2\r\n```\r\n\r\n```bat\r\nC:\\Proj\\msgreader>dir test2\r\n Volume in drive C has no label.\r\n Volume Serial Number is CA6D-4F59\r\n\r\n Directory of C:\\Proj\\msgreader\\test2\r\n\r\n2020/03/19  19:40    <DIR>          .\r\n2020/03/19  19:40    <DIR>          ..\r\n2020/03/19  19:40                11 A.txt\r\n               1 File(s)             11 bytes\r\n               2 Dir(s)   9,542,762,496 bytes free\r\n```\r\n\r\n```bat\r\nC:\\Proj\\msgreader>type test2\\A.txt\r\nattach test\r\n```\r\n\r\nChecking date times from `sent.msg`:\r\n\r\n```bat\r\nnode cli parse test\\sent.msg\r\n\r\n{\r\n  dataType: 'msg',\r\n  attachments: [],\r\n  recipients: [\r\n    {\r\n      dataType: 'recipient',\r\n      name: \"'xmailuser@xmailserver.test'\",\r\n      email: 'xmailuser@xmailserver.test',\r\n      recipType: 'to'\r\n    }\r\n  ],\r\n  senderEmail: 'xmailuser@xmailserver.test',\r\n  subject: 'Sent time',\r\n  body: 'Test mail\\r\\n\\r\\n',\r\n  senderName: 'xmailuser',\r\n  compressedRtf: Uint8Array(1409) [\r\n    ...\r\n  ],\r\n  creationTime: 'Mon, 15 Feb 2021 08:19:21 GMT',\r\n  lastModificationTime: 'Mon, 15 Feb 2021 08:19:21 GMT',\r\n  clientSubmitTime: 'Mon, 15 Feb 2021 08:19:04 GMT',\r\n  messageDeliveryTime: 'Mon, 15 Feb 2021 08:19:00 GMT'\r\n}\r\n```\r\n","readmeFilename":"README.md"}