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 🙏

© 2025 – Pkg Stats / Ryan Hefner

jww-parser

v2025.12.4

Published

JWW (Jw_cad) file parser and DXF converter for JavaScript/TypeScript

Readme

jww-parser

JWW (Jw_cad) file parser and DXF converter for JavaScript/TypeScript.

This package uses WebAssembly to parse JWW binary files (created by Jw_cad, a popular Japanese CAD software) and convert them to DXF format.

Installation

npm install jww-parser

Usage

Node.js

import { createParser } from 'jww-parser';
import { readFileSync } from 'fs';

async function main() {
  // Create and initialize the parser
  const parser = await createParser();

  // Read a JWW file
  const jwwData = readFileSync('drawing.jww');
  const data = new Uint8Array(jwwData);

  // Parse JWW to get document structure
  const doc = parser.parse(data);
  console.log('Entities:', doc.Entities.length);
  console.log('Layers:', doc.LayerGroups.length);

  // Convert to DXF string
  const dxfString = parser.toDxfString(data);
  writeFileSync('output.dxf', dxfString);
}

main();

Browser

<!-- Include wasm_exec.js from Go -->
<script src="wasm_exec.js"></script>
<script type="module">
  import { createParser } from 'jww-parser';

  async function convertFile(file) {
    const parser = await createParser('path/to/jww-parser.wasm');

    const buffer = await file.arrayBuffer();
    const data = new Uint8Array(buffer);

    // Get DXF content
    const dxfString = parser.toDxfString(data);

    // Download as file
    const blob = new Blob([dxfString], { type: 'application/dxf' });
    const url = URL.createObjectURL(blob);
    const a = document.createElement('a');
    a.href = url;
    a.download = file.name.replace('.jww', '.dxf');
    a.click();
  }
</script>

API

createParser(wasmPath?: string): Promise<JwwParser>

Create and initialize a JWW parser instance.

  • wasmPath - Optional path to the jww-parser.wasm file

JwwParser

init(): Promise<void>

Initialize the WASM module. Called automatically by createParser().

parse(data: Uint8Array): JwwDocument

Parse a JWW file and return the document structure.

toDxf(data: Uint8Array): DxfDocument

Parse a JWW file and convert to DXF document structure (JSON).

toDxfString(data: Uint8Array): string

Parse a JWW file and convert to DXF file content string.

Types

JwwDocument

interface JwwDocument {
  Version: number;
  Memo: string;
  PaperSize: number;
  LayerGroups: LayerGroup[];
  Entities: JwwEntity[];
  Blocks: JwwBlock[];
}

JwwEntity

Supported entity types:

  • JwwLine - Line segments
  • JwwArc - Arcs and circles
  • JwwPoint - Points
  • JwwText - Text annotations
  • JwwSolid - Solid fills
  • JwwBlockRef - Block references

DxfDocument

interface DxfDocument {
  Layers: DxfLayer[];
  Entities: DxfEntity[];
  Blocks: DxfBlock[];
}

Requirements

  • Node.js >= 18.0.0 (for Node.js usage)
  • Modern browser with WebAssembly support (for browser usage)

License

AGPL-3.0