npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mppwriter

v0.4.0

Published

Write and read Microsoft Project .mpp files from TypeScript — no Java, no .NET, no Project install

Readme

mppwriter

Read and write Microsoft Project .mpp files from TypeScript. No Java, no .NET, no Project install, no runtime dependencies. Works in Node and in the browser — the core takes bytes and returns bytes.

A port of pymppwriter, sharing its format notes and its test fixtures. Both implementations are checked against each other byte for byte, so a fix in one cannot silently diverge from the other.

Status: reading and writing both work. Container, record layer, writer and reader are done. The writer produces files byte-identical to the Python implementation given the same input, and both readers return the same model from the same file — asserted on every test run. Publishing to npm is next; see epic #54.

Install

npm install mppwriter

Writing a plan

import { MppWriter } from "mppwriter";

const D = (y: number, m: number, d: number, h = 0) => new Date(Date.UTC(y, m - 1, d, h));

const bytes = new MppWriter(templateBytes).build({
  title: "Robot build",
  start: D(2027, 3, 1, 8),
  tasks: [
    { uid: 1, name: "Design", start: D(2027, 3, 1, 8), finish: D(2027, 3, 2, 17), durationDays: 2 },
    { uid: 2, name: "Build", start: D(2027, 3, 3, 8), finish: D(2027, 3, 5, 17), durationDays: 3 },
  ],
  relations: [{ predUid: 1, succUid: 2 }],
});

build() takes and returns bytes, so it runs unchanged in the browser — hand it a template from a file input and download the result. Dates are read in UTC: the format stores wall-clock times with no zone, so Date.UTC(2027, 2, 1, 8) means 08:00 in the plan.

Pass newGuid and now to make output reproducible, and onWarning to catch the schedules Microsoft Project accepts but silently changes (a start earlier than its links allow, a start in non-working time, a task calendar sharing no working time with its resources').

Baselines

import { setBaseline, clearBaseline } from "mppwriter";

setBaseline(project);          // slot 0, the unnumbered Baseline
setBaseline(project, 3);       // Baseline3
clearBaseline(project, 0);

Saves the current schedule into one of the eleven slots, across all three entity classes:

| on a | baseline records | |---|---| | task | start, finish, duration and work, with summaries spanning their children | | assignment | start, finish and work — the task's schedule scaled by the assignment's units | | resource | work and cost, added up from its assignments (Project stores no dates here) |

They come back from readProject() as task.baselines, resource.baselines and assignment.baselines, each keyed by slot. The timephased baseline blobs that Project uses only for the usage views are not written — see docs/FORMAT_NOTES.md in the repository for why.

Reading a plan back

import { readProject } from "mppwriter";

const project = readProject(bytes);          // any MPP14 file, 2010 through M365
for (const task of project.tasks) {
  console.log(task.uid, task.name, task.durationDays, task.percentComplete);
}

readProject() returns the same shape build() takes, so a file can be read, edited and written again. Every offset comes from the file's own field maps, so it reads what any Project of that era wrote, not just what this library produced. Baselines come back on tasks, resources and assignments; costs and timephased data are not returned, as the writer does not model them either. A file that is not an MPP14 project throws MppReadError.

The container

import { readCfb, writeCfb, Storage } from "mppwriter";

const tree = readCfb(new Uint8Array(await file.arrayBuffer()));
console.log(tree.paths());                       // every stream in the file
const props = tree.get("   114/Props");          // a stream's bytes

const out = writeCfb(tree);                      // back to a .mpp container

Storage is an ordered tree of storages and streams. Children are held in a Map, never a plain object — JavaScript reorders integer-like keys, and this format is full of numeric names.

The record layer

import { parseProps, parseFieldMap, parseFixedMetaAuto, splitFixedData, PROPS_TASK_FIELD_MAP } from "mppwriter";

const { values } = parseProps(tree.get("   114/Props")!);
const fields = parseFieldMap(values.get(PROPS_TASK_FIELD_MAP)!);   // every offset comes from here
const meta = parseFixedMetaAuto(tree.get("   114/TBkndTask/FixedMeta")!, 47);
const records = splitFixedData(tree.get("   114/TBkndTask/FixedData")!, meta.items);

Field offsets are read from each file's own map rather than hard-coded, which is what lets one implementation handle every MPP14-era Project. encodeCp1252 is here too — JavaScript has no codec for it, and the OLE property sets need one.

Development

npm test        # node runs the TypeScript directly, no build step
npm run build   # dist/ with .d.ts declarations

Tests need no dependencies: Node's own test runner, and type stripping to run .ts sources. That means erasable syntax only — no parameter properties, enums or decorators.

The parity test shells out to the Python implementation in the parent repo and compares bytes; it skips when that is not present.