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

ezjww

v0.3.4

Published

JWW/JWC parser and DXF converter for TypeScript, powered by Rust WebAssembly.

Readme

ezjww for TypeScript

Read JWW and supported JWC drawings, inspect source records, and export DXF with a Rust parser compiled to WebAssembly.

Installation

Node.js 18 or later:

npm install ezjww

Read and convert a drawing

import { readFileSync, writeFileSync } from "node:fs";
import { detectFileFormat, readCadDocument, readDxfDocument, readDxfString } from "ezjww";

const data = readFileSync("drawing.jwc"); // also accepts JWW
console.log(detectFileFormat(data));     // "jww", "jwc", or null

const cad = readCadDocument(data);
if (cad.format === "jwc") {
  console.log(cad.document.header.paper, cad.document.header.source_version);
} else {
  console.log(cad.document.header.version);
}

const options = { jwcCoordinates: "model_millimeters" as const };
const dxf = readDxfDocument(data, options);
console.log(dxf.entities.length, dxf.jwc_conversion_report?.notices);
writeFileSync("drawing.dxf", readDxfString(data, {
  ...options,
  targetVersion: "AC1024",
}));

All readers accept Uint8Array, ArrayBuffer, and ArrayBufferView, respecting view offsets and lengths. Detection uses file contents, not the filename. A matching signature does not validate the complete file.

| Purpose | API | | --- | --- | | Detect either format | detectFileFormat | | Read either source document | readCadDocument | | Read JWW only | isJwwFile, readHeader, readDocument | | Read JWC only | isJwcFile, readJwcHeader, readJwcDocument | | Convert either format | readDxfDocument, readDxfString (toDxfString alias) |

DxfOptions accepts targetVersion ("AC1015" by default or "AC1024") for string output, explodeInserts (default false), maxBlockNesting (default 32, minimum 1), and jwcCoordinates ("paper_millimeters" by default or "model_millimeters"). The JWC coordinate option does not change JWW conversion.

JWC support

The supported binary document profiles are fixed2421_basic_v1 and fixed2389_basic_v1 (two header layouts, one record layout). They cover lines, circles, circular and elliptical arcs, rotated ellipses, CP932 text, points, and auxiliary points. Some curve sequences are represented as line segments. Settings and attribute bits outside the reference corpus are retained and reported as JWC_* diagnostics. Other JWC layouts are not covered by a general compatibility guarantee.

The source document retains original coordinates, names, attributes, and byte spans. header.source_version is currently null. DXF defaults to paper millimeters centered on the sheet with +Y up; model_millimeters applies each entity's own layer-group scale once.

DXF output preserves millimeter units and TEXT width factors. Rendering defaults for the palette, dashes, and font, along with text-spacing limits, are reported in jwc_conversion_report.notices. Unknown layouts or attributes, partial ellipses, and inconsistent string pools throw errors with byte offsets. Malformed JWC does not return a partial document; CP932 replacement decoding produces diagnostics.

See the API reference, JWC support and limits, and diagnostic codes. Repository documentation describes the source version; use documentation at your installed package's release tag when working with an older release.

Browser example

The npm entry point targets Node.js. The repository includes a browser example that builds the Rust WASM module for the web and parses selected files locally. For the browser build, use Node.js 22.12+ (or 20.19+ on the 20.x line), Rust, and pnpm. From a checkout:

cd packages/ezjww
pnpm install
pnpm run example:browser:dev

The app displays layers, source JSON, diagnostics, and previews, and can download converted DXF. For JWC, it offers paper/model coordinates and conversion notices. Invisible JWC layers are hidden; fonts are substituted. See the browser guide.

License

MIT