{"id":49656022,"url":"https://github.com/dotoritos-kim/dxf-json","last_synced_at":"2026-06-29T06:00:59.732Z","repository":{"id":218021086,"uuid":"745348088","full_name":"dotoritos-kim/dxf-json","owner":"dotoritos-kim","description":"perfect dxf parser","archived":false,"fork":false,"pushed_at":"2026-06-23T04:25:32.000Z","size":1977,"stargazers_count":127,"open_issues_count":11,"forks_count":17,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-06-23T06:14:57.971Z","etag":null,"topics":["autocad","cad","dwg","dxf","dxf-json","dxf-parser","javascript","json","korea","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dotoritos-kim.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["dotoritos-kim"]}},"created_at":"2024-01-19T06:20:01.000Z","updated_at":"2026-06-23T04:23:28.000Z","dependencies_parsed_at":"2025-07-29T02:29:51.715Z","dependency_job_id":"c64a0806-bd3b-4106-9882-fa7d154c2c8e","html_url":"https://github.com/dotoritos-kim/dxf-json","commit_stats":null,"previous_names":["kimkanghyune/dxf-json","dotoritos-kim/dxf-json"],"tags_count":68,"template":false,"template_full_name":null,"purl":"pkg:github/dotoritos-kim/dxf-json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotoritos-kim%2Fdxf-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotoritos-kim%2Fdxf-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotoritos-kim%2Fdxf-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotoritos-kim%2Fdxf-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dotoritos-kim","download_url":"https://codeload.github.com/dotoritos-kim/dxf-json/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotoritos-kim%2Fdxf-json/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34915002,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-29T02:00:05.398Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autocad","cad","dwg","dxf","dxf-json","dxf-parser","javascript","json","korea","typescript"],"created_at":"2026-05-06T09:07:19.511Z","updated_at":"2026-06-29T06:00:59.711Z","avatar_url":"https://github.com/dotoritos-kim.png","language":"TypeScript","funding_links":["https://github.com/sponsors/dotoritos-kim"],"categories":[],"sub_categories":[],"readme":"# DXF-JSON\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"100%\" src=\"https://github.com/dotoritos-kim/dxf-json/assets/14037015/a534bedc-3191-4f7b-a610-f3291a77ca6c\"\u003e\n\u003c/p\u003e\n\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\n![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge\u0026logo=github\u0026logoColor=white)![GitHub Actions](https://img.shields.io/badge/github%20actions-%232671E5.svg?style=for-the-badge\u0026logo=githubactions\u0026logoColor=white)\n\n![Visual Studio Code](https://img.shields.io/badge/Visual%20Studio%20Code-0078d7.svg?style=for-the-badge\u0026logo=visual-studio-code\u0026logoColor=white)![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge\u0026logo=typescript\u0026logoColor=white)\n\n[![NPM](https://img.shields.io/badge/NPM-%23CB3837.svg?style=for-the-badge\u0026logo=npm\u0026logoColor=white)](https://www.npmjs.com/package/dxf-json)\n\nDXF parser with rich type definitions.\n\n\u003e [!CAUTION]\n\u003e This is parser is not in stable state yet. Until version 1.0, we may often change name or type of the variables. We're adding rich unit/integration test, but there might be unexpected bug or uncovered situation. Note that [official DXF specification](https://documentation.help/AutoCAD-DXF/) is poorly documented, so that many informations are missing and even errors exist. Use your own risk. Thank you for your consideration.\n\n## Quick Start\n\n```\nnpm i dxf-json # or your loved package manager\n```\n\n```ts\nimport { readFileSync } from 'fs'\nimport { DxfParser } from 'dxf-json'\n\nconst content = readFileSync('foo.dxf', 'utf-8')\nconst parser = new DxfParser()\nconst parsedDxf = parser.parseSync(content)\n\n// play with your dxf file\nconst lwPolylines = parsedDxf.entities.filter(\n  (entity) =\u003e entity.type === 'LWPOLYLINE',\n)\n```\n\n### About `moduleResolution` in TypeScript\n\nIt's impossible to support both ESM and CJS with `node16`, because they detect type of modules only by `type` field in `package.json` or the extension of files. To support CJS with `node16`, we have to rename every `.d.ts` files into `.d.cts`, not only the file name but also every `import` expression in source files.\n\nBut Node16 is already deprecated, and to maintain the open source society healthy, we decided not to support `require` at that version. Also we **highly recommend to use ESM styled `import`** consistently throughout your source code.\n\n| Module Resolution | From ESM | From CJS |\n| ----------------- | -------- | -------- |\n| `node10`          | ✅       | ✅       |\n| `node16`          | ✅       | ❌       |\n| `bundler`         | ✅       | ✅       |\n\n## Features\n\n- Synchronous parsing, asynchronous parsing, and url fetch are possible.\n- Support both ESM and CJS\n- Support TypeScript\n\n\u003e [!NOTE]\n\u003e We support standard specification of dxf and AutoCAD features only. We're trying our best to support universal dxf files, but we don't support 3rd party specification.\n\n\u003cdetails\u003e\u003csummary\u003eCurrent Coverage\u003c/summary\u003e\n\nFor `dev` branch status, see [#52](https://github.com/dotoritos-kim/dxf-json/issues/52)\n\nBased on [AutoCAD 2024 DXF Reference](https://help.autodesk.com/view/OARX/2024/ENU/?guid=GUID-235B22E0-A567-4CF6-92D3-38A2306D73F3)\n\n- [x] HEADER Section\n- [x] CLASSES Section\n- [x] TABLES Section\n  - [x] APPID\n  - [x] BLOCK_RECORD\n  - [x] DIMSTYLE\n  - [x] LAYER\n  - [x] LTYPE\n  - [x] STYLE\n  - [x] UCS\n  - [x] VIEW\n  - [x] VPORT\n- [x] BLOCKS Section\n- [ ] ENTITIES Section\n  - [x] 3DFACE\n  - [x] 3DSOLID\n  - [ ] ACAD_PROXY_ENTITY\n  - [x] ARC\n  - [x] ARC_DIMENSION\n  - [x] ATTDEF\n  - [x] ATTRIB\n  - [x] BODY\n  - [x] CIRCLE\n  - [ ] COORDINATION MODEL\n  - [x] DIMENSION\n  - [x] ELLIPSE\n  - [x] HATCH\n  - [ ] HELIX\n  - [x] IMAGE\n  - [x] INSERT\n  - [x] LEADER\n  - [x] LIGHT\n  - [x] LINE\n  - [x] LWPOLYLINE\n  - [x] MESH\n  - [x] MLEADER\n  - [ ] MLEADERSTYLE\n  - [x] MLINE\n  - [x] MTEXT\n  - [ ] OLEFRAME\n  - [ ] OLE2FRAME\n  - [x] POINT\n  - [x] POLYLINE\n  - [x] RAY\n  - [x] REGION\n  - [x] SECTION\n  - [ ] SEQEND\n  - [ ] SHAPE\n  - [x] SOLID\n  - [x] SPLINE\n  - [x] SUN\n  - [ ] SURFACE\n  - [ ] TABLE\n  - [x] TEXT\n  - [x] TOLERANCE\n  - [ ] TRACE\n  - [ ] UNDERLAY\n  - [x] VERTEX\n  - [x] VIEWPORT\n  - [x] WIPEOUT\n  - [x] XLINE\n- [ ] OBJECTS Section\n  - [ ] DATATABLE\n  - [x] DICTIONARY\n  - [ ] DICTIONARYVAR\n  - [ ] DIMASSOC\n  - [ ] FIELD\n  - [ ] GEODATA\n  - [ ] GROUP\n  - [ ] IDBUFFER\n  - [ ] IMAGEDEF\n  - [ ] IMAGEDEF_REACTOR\n  - [ ] LAYER_FILTER\n  - [ ] LAYER_INDEX\n  - [x] LAYOUT\n  - [ ] LIGHTLIST\n  - [ ] MATERIAL\n  - [ ] MLINESTYLE\n  - [ ] OBJECT_PTR\n  - [x] PLOTSETTINGS\n  - [ ] RASTERVARIABLES\n  - [ ] RENDER\n  - [ ] SECTION\n  - [ ] SORTENSTABLE\n  - [x] SPATIAL_FILTER\n  - [ ] SPATIAL_INDEX\n  - [ ] SUNSTUDY\n  - [ ] TABLESTYLE\n  - [ ] UNDERLAYDEFINITION\n  - [ ] VBA_PROJECT\n  - [ ] VISUALSTYLE\n  - [ ] WIPEOUTVARIABLES\n  - [x] XRECORD\n- [x] THUMBNAILIMAGE Section\n\n\u003c/details\u003e\n\n\u003e [!NOTE]\n\u003e The documentation is not ready, but you can check the source code for used types [#1](https://github.com/dotoritos-kim/dxf-json/blob/main/src/parser/types.ts) and [#2](https://github.com/dotoritos-kim/dxf-json/blob/main/integration-test/src/types/import-test.ts)\n\n## Parsing Options\n\n### Thumbnail Image Format\n\nYou can configure how the `THUMBNAILIMAGE` section is parsed by setting the `thumbnailImageFormat` option:\n\n```ts\nimport { DxfParser } from 'dxf-json'\n\n// Default: base64 format (ready for web display)\nconst parser1 = new DxfParser()\nconst result1 = parser1.parseSync(dxfContent)\n// result1.thumbnailImage.data is a base64 string\n// Usage: \u003cimg src=\"data:image/bmp;base64,${result1.thumbnailImage.data}\" /\u003e\n\n// Hex format (raw hexadecimal string)\nconst parser2 = new DxfParser({ thumbnailImageFormat: 'hex' })\nconst result2 = parser2.parseSync(dxfContent)\n// result2.thumbnailImage.data is a hex string\n\n// Buffer format (Node.js Buffer object)\nconst parser3 = new DxfParser({ thumbnailImageFormat: 'buffer' })\nconst result3 = parser3.parseSync(dxfContent)\n// result3.thumbnailImage.data is a Buffer\n// Save to file: fs.writeFileSync('thumbnail.bmp', result3.thumbnailImage.data)\n```\n\n**Available formats:**\n- `'base64'` (default): Base64-encoded string, ideal for web applications\n- `'hex'`: Raw hexadecimal string from the DXF file\n- `'buffer'`: Node.js Buffer object for file operations\n\n\u003e [!NOTE]\n\u003e The thumbnail image in DXF files is typically in BMP format.\n\n### `parseSync`\n\n```ts\nconst parser = new DxfParser()\nreturn parser.parseSync(buffer)\n```\n\n### `parseStream`\n\n```ts\nimport fs from 'fs'\nconst parser = new DxfParser()\nconst fileStream = fs.createReadStream('dxf file path', { encoding: 'utf8' })\nreturn await parser.parseStream(fileStream)\n```\n\n### `parseUrl`\n\n```ts\nconst parser = new DxfParser()\nreturn await parser.parseFromUrl(url, encoding, RequestInit)\n```\n\n## Contribution\n\nSee [CONTRIBUTING.md](https://github.com/dotoritos-kim/dxf-json/blob/main/CONTRIBUTING.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotoritos-kim%2Fdxf-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdotoritos-kim%2Fdxf-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotoritos-kim%2Fdxf-json/lists"}