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

fast-3mf-loader

v0.0.7

Published

fast 3mf loader

Readme

fast-3mf-loader

A high-performance 3MF file parser that uses stream parsing and WebWorker multi-threading technology, offering lower memory usage and faster parsing speed. Written in TypeScript.

Features

  • 🚀 Stream Parsing - Supports chunked loading and parsing of large files, reducing memory usage
  • Multi-threaded Processing - Uses WebWorker for parallel parsing to improve performance
  • 📦 Lightweight and Efficient - Optimized memory management, especially suitable for large 3MF files
  • 🛠 TypeScript Support - Fully written in TypeScript with complete type definitions
  • 🌐 Browser Compatible - Can be used directly in modern browsers

Installation

npm install fast-3mf-loader
# or
yarn add fast-3mf-loader

Usage Example

import { ThreeMFLoader, fast3mfBuilder } from 'fast-3mf-loader';

// Get file using fetch
const response = await fetch('path/to/model.3mf');
const buffer = await response.arrayBuffer();

// Parse 3MF file
const loader = new ThreeMFLoader();
const xmlData = await loader.parse(buffer, (progress) => {
  console.log(`Parsing progress: ${progress}%`);
});

const group = fast3mfBuilder(xmlData);
console.log('Parsing result:', group);

API

ThreeMFLoader(data: Blob | ArrayBuffer, options?: ParseOptions): Promise<Model3MF>

Parses 3MF file and returns model data.

Parameters:

  • data: 3MF file data, ArrayBuffer
  • options: Optional configuration object
    • workerCount: number - Number of WebWorkers to use
    • onProgress: (progress: number) => void - Progress callback function

Return Value: Promise that resolves to an object containing 3D model data with the following structure:

interface Model3MF {
    rels: {
        target: string | null;
        id: string | null;
        type: string | null;
    }[];
    modelRels: {
        target: string | null;
        id: string | null;
        type: string | null;
    }[] | undefined;
    model: {
        [key: string]: {
            current: {
                currentObjectId: string;
                currentBasematerialsId: string;
                currentColorGroupId: string;
                currentTexture2dGroupId: string;
            };
            unit: string | undefined;
            version: string | undefined;
            transform: {};
            metadata: {};
            resources: {
                object: {
                    [key: string]: ObjectType;
                };
                basematerials: {
                    [key: string]: BasematerialsType;
                };
                texture2d: {
                    [key: string]: Texture2dType;
                };
                colorgroup: {
                    [key: string]: ColorGroupType;
                };
                texture2dgroup: {
                    [key: string]: Texture2dGroupType;
                };
                pbmetallicdisplayproperties: {
                    [key: string]: any;
                };
            };
            build: BuildItemType[];
            extensions: {
                [key: string]: string;
            };
            requiredExtensions: string | undefined;
        };
    };
    printTicket: {};
    texture: {
        [key: string]: ArrayBuffer;
    };
}

Performance Comparison

Compared to traditional 3MF parsers, fast-3mf-loader has significant advantages in large file processing:

| Metric | Traditional Parser | fast-3mf-loader | | ----------------------- | ------------------ | --------------- | | 100MB file parsing time | 8.0s | 2.7s | | Peak memory usage | | | | CPU utilization | | |

Browser Support

Supports all modern browsers (Chrome, Firefox, Safari, Edge, etc.) and environments that support WebWorker and Blob API.

Development

# Clone repository
git clone https://github.com/your-repo/fast-3mf-loader.git

# Install dependencies
npm install

# Development mode, develop test page
npm run dev

# Build production version
npm run build

# Run tests
npm test

Contributing

Issues and Pull Requests are welcome! Please ensure you follow the project's code style and test coverage requirements.