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

@mdzip/core-js

v1.3.2

Published

Core TypeScript/JavaScript library for MDZip (.mdz): pack, unpack, validate, and resolve entry points.

Readme

mdzip-core-js

Core TypeScript/JavaScript library for MDZip (.mdz) archives.

Current scope (core only):

  • open/unpack archive data
  • public archive listing/read APIs (listPaths, listEntries, readText, readBytes, readBase64, readDataUri)
  • manifest validation (MDZip spec 1.1.0 aligned, including manifest.mode)
  • entry-point resolution
  • archive conformance validation (errors + warnings)
  • archive mutation helpers (addFile, removeFile, removeFiles) with entry-point safety
  • orphaned image analysis (findOrphanedAssets) for cleanup workflows
  • path validation + resolution
  • package build helpers, including explicit mode support and advisory packaging warnings

ZIP runtime note:

  • This release line uses @progress/jszip-esm for ESM-compatible ZIP operations.

Install

npm install mdzip-core-js

Usage

import { MdzArchiveCore } from 'mdzip-core-js';

const archive = await MdzArchiveCore.open(fileOrArrayBuffer);
const entryPoint = await archive.resolveEntryPoint();
const manifest = await archive.readManifest();
const paths = archive.listPaths();
const markdown = await archive.readText(entryPoint);

const orphaned = await MdzArchiveCore.findOrphanedAssets(fileOrArrayBuffer);
if (orphaned.orphanedAssetPaths.length > 0) {
	await MdzArchiveCore.removeFiles(fileOrArrayBuffer, orphaned.orphanedAssetPaths);
}

Workspace API

App shells and embedded editors can open an archive as a normalized workspace model:

import { MdzArchiveCore, MdzPackagerCore } from 'mdzip-core-js';

const workspace = await MdzArchiveCore.openWorkspace(fileOrArrayBuffer, {
	includeOrphanedAssetAnalysis: true
});

workspace.documents[0].text = '# Updated\n';
const saved = await MdzPackagerCore.buildWorkspace(workspace, {
	title: 'Updated document'
});

Workspace assets include byte size, MIME type, broad asset kind, previewability, and lazy byte/data-URI readers. buildWorkspace() can round-trip assets opened through openWorkspace() or assets created with MdzPackagerCore.createWorkspaceAssetFromFile().

Manifest helpers are also available for app-safe metadata editing:

const manifest = MdzPackagerCore.updateManifest(workspace.manifest, {
	author: 'Ada',
	description: 'Project notes'
});

const { editable, reserved } = MdzPackagerCore.splitManifestMetadata(manifest);

Node Filesystem API

Node applications can package a directory or extract an archive using the Node-only export. Files are processed recursively and archive-relative paths are preserved.

import { extractArchive, packDirectory } from 'mdzip-core-js/node';

await packDirectory('./my-document', './my-document.mdz');
await extractArchive('./my-document.mdz', './my-document');

Both functions also return details for programmatic use:

import fs from 'node:fs/promises';

const packed = await packDirectory('./project');
await fs.writeFile('project.mdz', new Uint8Array(await packed.blob.arrayBuffer()));

const extracted = await extractArchive(archiveBytes, './output', {
	overwrite: true
});
console.log(extracted.extractedPaths);

packDirectory() rejects symbolic links and includes all regular files by default. Core packaging behavior can be customized with packOptions:

await packDirectory('./project', './project.mdz', {
	rootName: 'Project',
	packOptions: {
		mode: 'project',
		entryPoint: 'docs/index.md',
		createIndex: false,
		filters: ['**/*.md', '**/*.png']
	}
});

extractArchive() rejects absolute paths, path traversal, normalized path collisions, and attempts to write through symbolic links. Existing files are preserved unless overwrite: true is supplied.

Build

npm install
npm run build