Skip to content

TinyTapeout/gdsii

Repository files navigation

gdsii

GDSII file format parser for JavaScript.

NPM Version License: MIT or Apache-2.0 Types: TypeScript

Copyright (C) 2024, Tiny Tapeout LTD.

Usage

Install the package using npm:

npm install gdsii

Then you can use the parser in your code. Here's a minimal Node.js example that parses a GDS file and prints all records:

import { parseGDS, RecordType } from 'gdsii';
import fs from 'fs';

const gds = fs.readFileSync('path/to/your/file.gds');

for (const { tag, data } of parseGDS(gds)) {
  console.log(`${RecordType[tag]}:`, data);
}

Minimal SVG renderer example

The example directory contains a minimal SVG renderer that runs in the browser. You can run it by cloning the repository and running:

npm install
npm start

Running the tests

npm test

License

This project is licensed under either the MIT or Apache 2.0 license, at your option.