Alexandro.Net

Version 1.0.0

@stackline/wmf

Windows MetaFile (WMF) parser

Independent Stackline maintenance of wmf 1.0.2. The published license and original attribution are retained.

Installation

npm install --save-exact @stackline/wmf@1.0.0

To keep the upstream import name:

npm install --save-exact wmf@npm:@stackline/wmf@1.0.0

Usage and API

This is the README shipped with version 1.0.0. Retained upstream sections may describe older tooling, package names or browser compatibility. Use the exact scoped installation above, or the alias to preserve existing imports.

@stackline/wmf

Independently maintained Apache-2.0 fork of wmf@1.0.2. Original implementation, attribution and license are retained; this is not an official SheetJS release. The precise published source, git commit and SHA-512 integrity are recorded in UPSTREAM.json.

npm install @stackline/wmf
const library = require("@stackline/wmf");

Changes in 1.0.0

Development and verification

Use Node.js 18 or newer for development (verified locally with Node 24). Run npm ci --ignore-scripts, npm run build, npm run lint, npm test, and npm run test:package. The fork declares Node >=18 for its rebuilt distribution; the original Node >=0.8 declaration is not carried forward. Browser builds expose the same WMF global and four public functions, without requiring a Node Buffer polyfill. The renderer itself is retained, not rewritten.

lint is a JavaScript syntax check, not a claim of a full style/security analysis. All packages have no runtime npm dependencies. npm audit reports registry advisories only; absence of findings is not proof that all format parsing is safe.

Five regression tests cover Buffer, Uint8Array, ArrayBuffer, browser-global exports, drawing entrypoint and malformed inputs. Rendering fidelity for arbitrary real-world WMF records is not claimed.

Sources reviewed on 2026-09-27:

Publication is performed by the repository GitHub workflow; do not publish from a local checkout. This fork does not modify or publish @stackline/xlsx.

Original upstream documentation

The following retained documentation describes the original library and may use its original package name. For this fork install and import the scoped package shown above.


js-wmf

Processor for Windows MetaFile (WMF) files in JS (for the browser and nodejs).

Installation

With npm:

$ npm install wmf

In the browser:

<script src="wmf.js"></script>

The browser exposes a variable WMF.

Usage

The data argument is expected to be an ArrayBuffer, Uint8Array or Buffer

Notes

const { createImageData } = require("canvas");
global.ImageData = createImageData;
const size = WMF.image_size(data);
const canvas = new OffscreenCanvas(size[0], size[1]);

Examples

Browser Fetch into canvas (click to show)
// assume `canvas` is a DOM element
(async() => {
  const res = await fetch("url/for/image.wmf");
  const ab = await res.arrayBuffer();
  WMF.draw_canvas(ab, document.getElementById("canvas"));
})();
NodeJS (using `canvas` npm module) (click to show)
const { createCanvas, createImageData } = require("canvas");
global.ImageData = createImageData;

const size = WMF.image_size(data);
const canvas = createCanvas(size[0], size[1]);
WMF.draw_canvas(data, canvas);

License

Please consult the attached LICENSE file for details. All rights not explicitly granted by the Apache 2.0 License are reserved by the Original Author.

References

Published files and origin

These documents were read from the existing npm 1.0.0 archive. Its SHA-512 matches the current registry integrity value. This documentation update does not publish a new package or establish a new provenance or immutable-release verification.

Archive integrity
sha512-n/UuyEfZf0bpLNUI7kw8Nx2/z97DjtRuIdzQUOMAb3uIvhTAnd4E5TDmpFdzHSYipCPYlHwehORbBhrd53RuzQ==