# epfromer/pst-extractor architecture

> Architecture diagram of the GitHub repository epfromer/pst-extractor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/epfromer/pst-extractor
- Repository: https://github.com/epfromer/pst-extractor

## Overview

pst-extractor is a Node.js library for reading Outlook/Exchange PST files and exposing their contents as typed objects. The principal workflow is: a consumer opens a PSTFile, obtains its root folder, walks subfolders and messages, then reads message fields or streams attachment data. Parsing uses file/index access, node streams and table decoding before object dispatch. The README also advertises calendar, contact, task and other object access. The sampled excerpts support the main navigation and decoding links; wiring for some unsampled object types is therefore shown only where documented or directly evidenced.

Main entry points: [`src/PSTFolder.class.ts`](https://github.com/epfromer/pst-extractor/blob/master/src/PSTFolder.class.ts) (Folder Walker), [`src/PSTNodeInputStream.class.ts`](https://github.com/epfromer/pst-extractor/blob/master/src/PSTNodeInputStream.class.ts) (Node Stream), [`src/PSTUtil.class.ts`](https://github.com/epfromer/pst-extractor/blob/master/src/PSTUtil.class.ts) (Object Dispatcher), [`src/PSTFile.class.ts`](https://github.com/epfromer/pst-extractor/blob/master/src/PSTFile.class.ts) (PST File)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Library Entry"]
  node_exports["Public Exports<br/>[index.ts]"]
end

subgraph group_file["PST Parsing"]
  node_pstfile["PST File<br/>[PSTFile.class.ts]"]
  node_message_store["Message Store"]
end

subgraph group_objects["Content Objects"]
  node_folder["Folder Walker<br/>[PSTFolder.class.ts]"]
  node_factory["Object Dispatcher<br/>[PSTUtil.class.ts]"]
  node_message["Email Message"]
  node_attachment["Attachments"]
  node_contact["Contacts"]
  node_appointment["Calendar Items"]
  node_task["Tasks<br/>[PSTTask.class.ts]"]
  node_activity["Activities"]
  node_recurrence["Recurrence Data"]
end

subgraph group_decode["Decode Primitives"]
  node_object_base["Property Access<br/>[PSTObject.class.ts]"]
  node_node_stream["Node Stream"]
  node_table_bc["Property Tables"]
  node_table_7c["Row Tables"]
  node_descriptor["Descriptor Index"]
  node_descriptor_item["Descriptor Data"]
  node_offset_item["Offset Index"]
  node_util["Format Utilities<br/>[PSTUtil.class.ts]"]
end

node_consumer(("Library Consumer"))

node_consumer -->|"uses API"| node_exports
node_consumer -->|"opens PST"| node_pstfile
node_pstfile -->|"loads store"| node_message_store
node_consumer -->|"gets root"| node_folder
node_folder -->|"walks children"| node_folder
node_folder -->|"dispatches child"| node_factory
node_factory -->|"creates folder"| node_folder
node_factory -->|"creates message"| node_message
node_factory -->|"creates contact"| node_contact
node_factory -->|"creates appointment"| node_appointment
node_message -->|"inherits access"| node_object_base
node_contact -->|"extends message"| node_message
node_appointment -->|"extends message"| node_message
node_appointment -->|"exposes recurrence"| node_recurrence
node_message -->|"reads recipients"| node_table_7c
node_folder -->|"reads folder rows"| node_table_7c
node_folder -->|"uses properties"| node_table_bc
node_object_base -->|"reads property rows"| node_table_bc
node_attachment -->|"opens attachment data"| node_node_stream
node_node_stream -->|"reads file bytes"| node_pstfile
node_pstfile -->|"loads index nodes"| node_descriptor
node_pstfile -->|"loads offset nodes"| node_offset_item
node_node_stream -->|"reads descriptor data"| node_descriptor_item
node_table_7c -->|"decodes stream"| node_node_stream
node_table_bc -->|"decodes stream"| node_node_stream
node_object_base -->|"decodes values"| node_util
node_node_stream -->|"decodes bytes"| node_util

click node_exports "https://github.com/epfromer/pst-extractor/blob/master/src/index.ts"
click node_pstfile "https://github.com/epfromer/pst-extractor/blob/master/src/PSTFile.class.ts"
click node_message_store "https://github.com/epfromer/pst-extractor/blob/master/src/PSTMessageStore.class.ts"
click node_folder "https://github.com/epfromer/pst-extractor/blob/master/src/PSTFolder.class.ts"
click node_factory "https://github.com/epfromer/pst-extractor/blob/master/src/PSTUtil.class.ts"
click node_message "https://github.com/epfromer/pst-extractor/blob/master/src/PSTMessage.class.ts"
click node_attachment "https://github.com/epfromer/pst-extractor/blob/master/src/PSTAttachment.class.ts"
click node_contact "https://github.com/epfromer/pst-extractor/blob/master/src/PSTContact.class.ts"
click node_appointment "https://github.com/epfromer/pst-extractor/blob/master/src/PSTAppointment.class.ts"
click node_task "https://github.com/epfromer/pst-extractor/blob/master/src/PSTTask.class.ts"
click node_activity "https://github.com/epfromer/pst-extractor/blob/master/src/PSTActivity.class.ts"
click node_recurrence "https://github.com/epfromer/pst-extractor/blob/master/src/RecurrencePattern.class.ts"
click node_object_base "https://github.com/epfromer/pst-extractor/blob/master/src/PSTObject.class.ts"
click node_node_stream "https://github.com/epfromer/pst-extractor/blob/master/src/PSTNodeInputStream.class.ts"
click node_table_bc "https://github.com/epfromer/pst-extractor/blob/master/src/PSTTableBC.class.ts"
click node_table_7c "https://github.com/epfromer/pst-extractor/blob/master/src/PSTTable7C.class.ts"
click node_descriptor "https://github.com/epfromer/pst-extractor/blob/master/src/DescriptorIndexNode.class.ts"
click node_descriptor_item "https://github.com/epfromer/pst-extractor/blob/master/src/PSTDescriptorItem.class.ts"
click node_offset_item "https://github.com/epfromer/pst-extractor/blob/master/src/OffsetIndexItem.class.ts"
click node_util "https://github.com/epfromer/pst-extractor/blob/master/src/PSTUtil.class.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_exports toneBlue
class node_pstfile,node_message_store toneAmber
class node_folder,node_factory,node_message,node_attachment,node_contact,node_appointment,node_task,node_activity,node_recurrence toneMint
class node_object_base,node_node_stream,node_table_bc,node_table_7c,node_descriptor,node_descriptor_item,node_offset_item,node_util toneRose
class node_consumer toneIndigo
```

## Components

### Library Entry

- [Public Exports](https://github.com/epfromer/pst-extractor/blob/master/src/index.ts): `src/index.ts`

### PST Parsing

- [PST File](https://github.com/epfromer/pst-extractor/blob/master/src/PSTFile.class.ts): `src/PSTFile.class.ts`
- [Message Store](https://github.com/epfromer/pst-extractor/blob/master/src/PSTMessageStore.class.ts): `src/PSTMessageStore.class.ts`

### Content Objects

- [Folder Walker](https://github.com/epfromer/pst-extractor/blob/master/src/PSTFolder.class.ts): `src/PSTFolder.class.ts`
- [Object Dispatcher](https://github.com/epfromer/pst-extractor/blob/master/src/PSTUtil.class.ts): `src/PSTUtil.class.ts`
- [Email Message](https://github.com/epfromer/pst-extractor/blob/master/src/PSTMessage.class.ts): `src/PSTMessage.class.ts`
- [Attachments](https://github.com/epfromer/pst-extractor/blob/master/src/PSTAttachment.class.ts): `src/PSTAttachment.class.ts`
- [Contacts](https://github.com/epfromer/pst-extractor/blob/master/src/PSTContact.class.ts): `src/PSTContact.class.ts`
- [Calendar Items](https://github.com/epfromer/pst-extractor/blob/master/src/PSTAppointment.class.ts): `src/PSTAppointment.class.ts`
- [Tasks](https://github.com/epfromer/pst-extractor/blob/master/src/PSTTask.class.ts): `src/PSTTask.class.ts`
- [Activities](https://github.com/epfromer/pst-extractor/blob/master/src/PSTActivity.class.ts): `src/PSTActivity.class.ts`
- [Recurrence Data](https://github.com/epfromer/pst-extractor/blob/master/src/RecurrencePattern.class.ts): `src/RecurrencePattern.class.ts`

### Decode Primitives

- [Property Access](https://github.com/epfromer/pst-extractor/blob/master/src/PSTObject.class.ts): `src/PSTObject.class.ts`
- [Node Stream](https://github.com/epfromer/pst-extractor/blob/master/src/PSTNodeInputStream.class.ts): `src/PSTNodeInputStream.class.ts`
- [Property Tables](https://github.com/epfromer/pst-extractor/blob/master/src/PSTTableBC.class.ts): `src/PSTTableBC.class.ts`
- [Row Tables](https://github.com/epfromer/pst-extractor/blob/master/src/PSTTable7C.class.ts): `src/PSTTable7C.class.ts`
- [Descriptor Index](https://github.com/epfromer/pst-extractor/blob/master/src/DescriptorIndexNode.class.ts): `src/DescriptorIndexNode.class.ts`
- [Descriptor Data](https://github.com/epfromer/pst-extractor/blob/master/src/PSTDescriptorItem.class.ts): `src/PSTDescriptorItem.class.ts`
- [Offset Index](https://github.com/epfromer/pst-extractor/blob/master/src/OffsetIndexItem.class.ts): `src/OffsetIndexItem.class.ts`
- [Format Utilities](https://github.com/epfromer/pst-extractor/blob/master/src/PSTUtil.class.ts): `src/PSTUtil.class.ts`

### Other components

- **Library Consumer**

## Connections

- Library Consumer → Public Exports: uses API
- Library Consumer → PST File: opens PST
- PST File → Message Store: loads store
- Library Consumer → Folder Walker: gets root
- Folder Walker → Folder Walker: walks children
- Folder Walker → Object Dispatcher: dispatches child
- Object Dispatcher → Folder Walker: creates folder
- Object Dispatcher → Email Message: creates message
- Object Dispatcher → Contacts: creates contact
- Object Dispatcher → Calendar Items: creates appointment
- Email Message → Property Access: inherits access
- Contacts → Email Message: extends message
- Calendar Items → Email Message: extends message
- Calendar Items → Recurrence Data: exposes recurrence
- Email Message → Row Tables: reads recipients
- Folder Walker → Row Tables: reads folder rows
- Folder Walker → Property Tables: uses properties
- Property Access → Property Tables: reads property rows
- Attachments → Node Stream: opens attachment data
- Node Stream → PST File: reads file bytes
- PST File → Descriptor Index: loads index nodes
- PST File → Offset Index: loads offset nodes
- Node Stream → Descriptor Data: reads descriptor data
- Row Tables → Node Stream: decodes stream
- Property Tables → Node Stream: decodes stream
- Property Access → Format Utilities: decodes values
- Node Stream → Format Utilities: decodes bytes
