Skip to content

Tensor-Estate/tsmpp

Repository files navigation

@tensor-estate/tsmpp

Minimal Bun-only TypeScript parser for Microsoft Project .mpp files.

tsmpp extracts project and task names, hierarchy, predecessor links, baseline dates, visible task-list columns, custom field values, and task-table formatting from modern Microsoft Project files.

Features

  • Parses .mpp compound document files directly in TypeScript.
  • Returns a normalized project/task model for UI or data pipelines.
  • Preserves hierarchy, milestones, baseline dates, predecessor task/type links, custom columns, and table cell styles.
  • Ships as a strict ESM package for Bun with package.json exports.
  • Ships with synthetic tests only. No proprietary or real project files are included.
  • Tested and supported on Bun 1.3.10 and newer.

Install

bun add @tensor-estate/tsmpp

For local development from a sibling checkout:

bun add @tensor-estate/tsmpp@file:../tsmpp

Usage

import { parseMPP } from "@tensor-estate/tsmpp";

const file = Bun.file("./example.mpp");
const project = await parseMPP(await file.arrayBuffer());

console.log(project.name);
console.log(project.tasks.length);
console.log(project.tasks[0]?.name);

Run Bun scripts with:

bun run ./example.ts

API

import {
  addWorkingDays,
  computeHierarchy,
  getWorkingDurationDays,
  mppTimestampToISO,
  parseMPP,
} from "@tensor-estate/tsmpp";

Key exported types:

  • ProjectData
  • ProjectTask
  • Predecessor
  • ProjectTaskTableColumn
  • ProjectTaskCellStyle

Supported parsed fields:

  • project/task names
  • hierarchy and summary state
  • start, finish, duration, and milestone detection
  • baseline start and finish dates
  • predecessor task IDs and link types
  • visible task-list columns, custom values, and cell styles

Not supported in 0.1.0:

  • WBS values
  • percent complete
  • predecessor lag values

Development

bun install
bun run lint
bun run typecheck
bun test
bun run build

Build outputs:

  • dist/parse-mpp.js for ESM runtime
  • dist/parse-mpp.d.ts for type declarations

The package is intentionally Bun-only and ESM-only. Node.js and CommonJS compatibility are not provided.

Publishing

GitHub Actions are configured to:

  • run CI on pushes and pull requests
  • verify package metadata with publint
  • publish to npm when a v*.*.* tag is pushed

The publish workflow uses GitHub Actions trusted publishing with actions/setup-node, then runs npm publish --access public after Bun-based verification.

License

MIT

About

Minimal TypeScript parser for Microsoft Project MPP files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors