circuit-json-to-gerber
v0.0.113
Published
Convert a [Circuit JSON](https://github.com/tscircuit/circuit-json) to Gerber/Excellon files.
Readme
circuit-json-to-gerber
Convert a Circuit JSON to Gerber/Excellon files.
Installation
# Global installation for CLI usage
npm install -g circuit-json-to-gerberCLI Usage
Convert a circuit JSON file to Gerber/Excellon files:
# Basic usage - outputs to input.gerbers.zip
circuit-to-gerber input.circuit.json
# Specify custom output file
circuit-to-gerber input.circuit.json -o output.zipThe output ZIP file will contain:
- Gerber files (*.gbr) for each layer
- Plated drill file (plated.drl)
- Unplated drill file (unplated.drl)
Library Usage
import { convertCircuitJsonToGerberFiles } from "circuit-json-to-gerber"
const files = convertCircuitJsonToGerberFiles(circuitJson)
// The result is filesystem-neutral and includes Gerber and Excellon files.
// Write it to disk, add it to a ZIP, or store it with any file API.
for (const [fileName, contents] of Object.entries(files)) {
await output.write(fileName, contents)
}Lower-level command conversion and stringification APIs remain available when custom layer processing is needed.
