You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A TypeScript library for parsing metadata from 3D printing slicer files
Supported File Formats
File Format
Extension
Description
G-Code
.gcode, .g
Standard G-Code files from various slicers
GX Binary
.gx
FlashForge binary format with embedded thumbnails
3MF Archive
.3mf
ZIP-based 3D manufacturing format with metadata
Supported Slicers
Slicer
Detection
Metadata Support
FlashPrint
Header-based
Full support for printer model, filament type, timestamps
Orca-FlashForge
Header-based
Advanced metadata including detailed filament tracking
OrcaSlicer
Header-based
Block-based metadata with Base64 thumbnails
Legacy GX
Format-based
Binary format with embedded G-Code parsing
Feature Coverage
Feature
G-Code
GX Binary
3MF Archive
Slicer Detection
Yes
Yes
Yes
Version & Timestamp
Yes
Yes
Yes
Print Time (ETA)
Yes
Yes
Yes
Filament Usage (mm/g)
Yes
Yes
Yes
Filament Type
Yes
Yes
Yes
Filament Color
No
No
Yes
Multiple Filaments
Limited
Limited
Yes
Printer Model
Yes
Yes
Yes
Thumbnail Extraction
Base64
Binary
Base64
Support Detection
No
No
Yes
Model File Names
No
No
Yes
Plate Images
No
No
Yes
Parsing Capabilities
Capability
Description
Auto-Detection
Automatically detects file type based on extension
Universal Interface
Single function handles all supported formats
Slicer Identification
Determines slicer type from file headers
Metadata Extraction
Parses comments and embedded metadata blocks
Thumbnail Processing
Extracts and decodes Base64 encoded images
Unit Conversion
Converts filament usage to meters automatically
Filtered Results
Shows only filaments actually used in print
Binary Parsing
Handles GX binary format with embedded G-Code
Archive Processing
Unzips and parses 3MF container structure
Installation
Configure npm to use the GitHub Packages registry by adding the following to a .npmrc file in your project root:
@parallel-7:registry=https://npm.pkg.github.com/
Install the package:
npm install @parallel-7/slicer-meta
You will need to authenticate with GitHub Packages to download private packages.
Basic Usage
The primary method for parsing slicer files is the parseSlicerFile function, which automatically handles all supported file formats:
import{parseSlicerFile}from'@parallel-7/slicer-meta';asyncfunctionmain(){try{constfilePath='path/to/your/file.gcode';constmetadata=awaitparseSlicerFile(filePath);console.log('Slicer Info:',metadata.slicer);console.log('File Info:',metadata.file);if(metadata.threeMf){console.log('3MF Specific Info:',metadata.threeMf);}}catch(error){console.error('Failed to parse file:',error);}}main();