@hpcreery/tracespace-parser
v5.0.4
Published
Parse Gerber/drill files into abstract syntax trees.
Downloads
199
Maintainers
Readme
@hpcreery/tracespace-parser
Parse Gerber/drill files into abstract syntax trees based on the unist format. Part of the tracespace collection of PCB visualization tools.
This module is one part of the tracespace render pipeline, and you may not need to use it directly. See @tracespace/core to integrate the full render pipeline into your project.
npm install @hpcreery/tracespace-parser@next
usage
import fs from 'node:fs/promises'
import {parse} from '@hpcreery/tracespace-parser'
const gerberContents = await fs.readFile('gerber.gbr', 'utf-8')
const syntaxTree = parse(gerberContents)
await fs.writeFile('parse.json', JSON.stringify(syntaxTree, null, 2), 'utf-8')