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

acadrust.js

v0.0.1

Published

TypeScript bindings for acadrust, a Rust CAD library.

Readme

acadrust.js

TypeScript bindings for acadrust, a Rust library for reading and writing CAD files.

The package exposes a compact TypeScript API for DXF/DWG reading, entity inspection for all acadrust entity variants, JSON-safe document snapshots, and DXF/DWG writing. Native bindings are implemented with napi-rs, while acadrust is consumed as an unmodified Cargo dependency.

Release automation hardening and editing APIs are planned future work.

Goals

  • Provide a practical Node.js package for reading and writing DXF and DWG files.
  • Keep the TypeScript API stable and smaller than the internal Rust API.
  • Use acadrust through Cargo without copying or modifying its source.
  • Preserve a clear license boundary between this package and acadrust.

License

Original code in this repository is licensed under MIT.

acadrust is licensed under MPL-2.0 and is not relicensed by this project. See LICENSE.md and THIRD_PARTY_NOTICES.md for details.

Development

npm install
npm test
npm run check
npm run prebuild:packages
npm run prebuild:verify
cargo test

Current API

import { AcadrustJsError, readDxf } from "acadrust.js";

try {
  const doc = await readDxf("drawing.dxf");
  console.log(doc.version);
  console.log(doc.summary());
  console.log(doc.entities({ type: "LINE" }));
  await doc.writeDxf("copy.dxf");
  await doc.writeDwg("copy.dwg");
} catch (error) {
  if (error instanceof AcadrustJsError) {
    console.error(error.code, error.message);
  }
}

The async read/write APIs run through napi-rs async tasks. Sync APIs remain available for convenience, but they block the Node.js thread while parsing or writing.

The current package entrypoint is ESM. Type-only subpath imports are available from acadrust.js/types, and stable error constants/classes are available from acadrust.js/errors.

Browser Sample

examples/browser/index.html is a static CAD preview that renders a generated DrawingJson snapshot on a canvas. Open it directly in a browser, or regenerate the sample data after changing the fixture/projection code:

npm run build
npm run example:browser:data

examples/vercel is a deployable DXF preview app. It uploads DXF bytes to a Vercel Node function, parses them with acadrust.js, and renders the returned DrawingJson in the browser. See examples/vercel/README.md for deployment steps.

Prebuilt Binaries

The root package is kept JavaScript-only for release packaging. Native binaries are loaded either from a local development build or from an optional platform package named acadrust.js-<platform-arch-abi>.

Configured prebuild targets:

  • linux-x64-gnu
  • linux-arm64-gnu
  • darwin-x64
  • darwin-arm64
  • win32-x64-msvc
  • win32-arm64-msvc

The .github/workflows/prebuild.yml workflow builds these targets on matching GitHub-hosted runners, uploads each .node file, copies artifacts into the npm/ package layout, links platform packages as optional dependencies for the release workspace, and runs npm pack --dry-run for the root package and each platform package.