Dxf Parser is a javascript parser for dxf files. It reads dxf files into one large javascript object with readable properties and a more logical structure.
Also, keep an eye on three-dxf, a browser module for rendering the output of Dxf-Parser in the browser.
npm install dxf-parser
Browsers -- As of 0.1.3 standalone browserify version is in the commonjs/ folder. Copy it out of the install directory or just download it from the GitHub repo directly. We may evetually publish this to bower, but the build environment needs a little work first.
import DxfParser from 'dxf-parser';
// Grab fileText in node.js or browser
const fileText = ...;
const parser = new DxfParser();
try {
const dxf = parser.parse(fileText);
} catch(err) {
return console.error(err.stack);
}
See the wiki Example Output page to get an idea of what the results look like.
node.js
npm install
npm run build
node samples/node/parseSync
node samples/node/parseStream
browser - the three-dxf repo has a sample for viewing dxf cad in the browser
Support
Does not yet support
See the wiki for info on contributing
npm install -g mocha
//Then
npm test
//OR
mocha test