open-index/open-npm huggingface dataset:
npm package: @hpcreery/tracespace-parser
Description: Parse Gerber/drill files into abstract syntax trees.
Latest version: 5.0.4

# @hpcreery/tracespace-parser

[![npm][npm badge]][npm package]

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.

```shell
npm install @hpcreery/tracespace-parser@next
```

[gerber]: https://en.wikipedia.org/wiki/Gerber_format
[drill]: https://en.wikipedia.org/wiki/PCB_NC_formats
[unist]: https://unifiedjs.com/
[tracespace]: https://github.com/tracespace/tracespace
[@tracespace/core]: ../core
[npm package]: https://www.npmjs.com/package/@hpcreery/tracespace-parser/v/next
[npm badge]: https://img.shields.io/npm/v/@hpcreery/tracespace-parser/next?style=flat-square

## usage

```js
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')
```
npm package: @hpcreery/tracespace-plotter
Description: Plot @hpcreery/tracespace-parser ASTs into image trees.
Latest version: 5.0.3

# @hpcreery/tracespace-plotter

[![npm][npm badge]][npm package]

Plot [@hpcreery/tracespace-parser][] ASTs into image trees. 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.

```shell
npm install @hpcreery/tracespace-plotter@next
```

[tracespace]: https://github.com/tracespace/tracespace
[@hpcreery/tracespace-parser]: ../parser
[@tracespace/core]: ../core
[npm package]: https://www.npmjs.com/package/@hpcreery/tracespace-plotter/v/next
[npm badge]: https://img.shields.io/npm/v/@hpcreery/tracespace-plotter/next?style=flat-square

## usage

```js
import fs from 'node:fs/promises'
import {parse} from '@hpcreery/tracespace-parser'
import {plot} from '@hpcreery/tracespace-plotter'

const gerberContents = await fs.readFile('gerber.gbr', 'utf-8')
const syntaxTree = parse(gerberContents)
const imageTree = plot(syntaxTree)

await fs.writeFile('plot.json', JSON.stringify(imageTree, null, 2), 'utf-8')
```
npm package: @hpcreery/tracespace-renderer
Description: Render @hpcreery/tracespace-plotter image trees as SVGs.
Latest version: 5.0.3

# @hpcreery/tracespace-renderer

[![npm][npm badge]][npm package]

Render [@hpcreery/tracespace-plotter][] image trees as SVGs. 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.

```shell
npm install @hpcreery/tracespace-renderer@next
```

[tracespace]: https://github.com/tracespace/tracespace
[@hpcreery/tracespace-plotter]: ../plotter
[@tracespace/core]: ../core
[npm package]: https://www.npmjs.com/package/@hpcreery/tracespace-renderer/v/next
[npm badge]: https://img.shields.io/npm/v/@hpcreery/tracespace-renderer/next?style=flat-square

## usage

```js
import fs from 'node:fs/promises'
import {toHtml} from 'hast-util-to-html'

import {parse} from '@hpcreery/tracespace-parser'
import {plot} from '@hpcreery/tracespace-plotter'
import {render} from '@hpcreery/tracespace-renderer'

const gerberContents = await fs.readFile('gerber.gbr', 'utf-8')
const syntaxTree = parse(gerberContents)
const imageTree = plot(syntaxTree)
const image = render(imageTree)

await fs.writeFile('render.svg', toHtml(image), 'utf-8)
```