{"_id":"@alexander-belokon/dxf","name":"@alexander-belokon/dxf","dist-tags":{"latest":"5.1.0"},"versions":{"5.1.0":{"name":"@alexander-belokon/dxf","version":"5.1.0","description":"DXF parser for node/browser","main":"lib/index.js","bin":{"dxf-to-svg":"lib/cli.js"},"engines":{"node":">=8.9.0"},"scripts":{"compile":"babel -d lib/ src/","dist":"browserify lib/index.js --standalone dxf -o dist/dxf.js","lint":"eslint src test","prepublishOnly":"npm run lint && npm run test && rimraf dist/ lib/ && npm run compile && npm run dist","prettier":"prettier --write .","test":"npm run test:unit","test:functional":"cd test/functional && webpack-dev-server","test:unit":"mocha --require @babel/register --recursive test/unit/**","test:unit:watch":"npm run test:unit -- --watch"},"repository":{"type":"git","url":"git://github.com/AlexanderBelokon/dxf.git"},"keywords":["DXF","Parser","SVG"],"author":{"name":"Ben Nortier","email":"ben@bjnortier.com"},"license":"MIT","bugs":{"url":"https://github.com/skymakerolof/dxf/issues"},"homepage":"https://github.com/skymakerolof/dxf","devDependencies":{"@babel/cli":"^7.21.5","@babel/core":"^7.22.1","@babel/eslint-parser":"^7.21.8","@babel/preset-env":"^7.22.4","@babel/preset-react":"^7.22.3","@babel/register":"^7.21.0","babel-loader":"^9.1.2","browserify":"^16.5.2","eslint":"^8.42.0","eslint-config-prettier":"^8.8.0","eslint-config-standard":"^17.1.0","eslint-config-standard-react":"^13.0.0","eslint-plugin-import":"^2.27.5","eslint-plugin-n":"^16.0.0","eslint-plugin-promise":"^6.1.1","eslint-plugin-react":"^7.32.2","eslint-plugin-react-hooks":"^4.6.0","expect":"^29.5.0","mocha":"^10.2.0","prettier":"^2.8.8","prop-types":"^15.8.1","raw-loader":"^4.0.2","react":"^16.14.0","react-dom":"^16.14.0","react-router-dom":"^5.3.4","rimraf":"^5.0.1","standard-version":"^9.5.0","webpack":"^5.86.0","webpack-cli":"^5.1.4","webpack-dev-server":"^4.15.0","xml2js":"^0.6.0"},"dependencies":{"commander":"^2.20.3","lodash":"^4.17.15","vecks":"^3.9.0"},"standard":{"globals":["describe","it","before","beforeEach","after"],"ignore":["lib/","dist/"]},"gitHead":"2fa597b429cd7023ef071bebf167c50330a6cf82","_id":"@alexander-belokon/dxf@5.1.0","_nodeVersion":"14.21.3","_npmVersion":"6.14.18","dist":{"integrity":"sha512-E+/zfHOBMl73fJoJsT2AwL+X22rrpZrfRL9IxYPiIFw06W0/tYQ23B8JvV52wUQsxGnBdWK71HK5nMvFszYE2Q==","shasum":"3ee10c895cffe325c27257b9d32efc8f7f9c298f","tarball":"https://registry.npmjs.org/@alexander-belokon/dxf/-/dxf-5.1.0.tgz","fileCount":108,"unpackedSize":530744,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDVGTLFjhB+YdF7pTCC5FQlWlvZBlw6S7KsnS4OT1tyAAIhAM54jUhVZ/z+HFaIMnCb4oXT29ypUSXosBAzLo0ZV81b"}]},"_npmUser":{"name":"alexander-belokon","email":"alexander@belokon.net"},"directories":{},"maintainers":[{"name":"alexander-belokon","email":"alexander@belokon.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dxf_5.1.0_1691348162960_0.5793862539291181"},"_hasShrinkwrap":false}},"time":{"created":"2023-08-06T18:56:02.883Z","5.1.0":"2023-08-06T18:56:03.093Z","modified":"2023-08-06T18:56:03.257Z"},"maintainers":[{"name":"alexander-belokon","email":"alexander@belokon.net"}],"description":"DXF parser for node/browser","homepage":"https://github.com/skymakerolof/dxf","keywords":["DXF","Parser","SVG"],"repository":{"type":"git","url":"git://github.com/AlexanderBelokon/dxf.git"},"author":{"name":"Ben Nortier","email":"ben@bjnortier.com"},"bugs":{"url":"https://github.com/skymakerolof/dxf/issues"},"license":"MIT","readme":"[![Build Status](https://travis-ci.org/bjnortier/dxf.svg?branch=master)](https://travis-ci.org/bjnortier/dxf)\n\n# dxf\n\nDXF parser for node/browser.\n\nUses several ES6 features in the source code (import, classes, let, const, arrows) but is packaged using babel so you can use it in legacy JS environments.\n\nVersion 2.0 is a complete rewrite from the first attempt to write it in a SAX style, which wasn't really appropriate for a document with nested references (e.g inserts referencing blocks, nested inserts).\n\nVersion 3.0 converted the codebase to use [standard JS](https://standardjs.com), ES6 imports, stopped using Gulp, and updated & removed some dependencies.\n\nVersion 4.x is in progress and the aim is to use native SVG elements where possible, e.g. `<circle />`, `<ellipse />` etc. 4.0 introduces the `<circle />` element.\n\nAt this point in time, the important geometric entities are supported, but notably:\n\n- MTEXT\n- DIMENSION\n- STYLE\n- HATCH\n\nand some others are **parsed**, but are **not supported for SVG rendering** (see section below on SVG rendering)\n\n## Getting started\n\nThere is an ES5 and ES6 example in the `examples/` directory that show how to use the library. There are exposed functions for advanced users, but for the majority of users you can use the `Helper` object to get the data you're interested in (or convert to SVG):\n\n```\nconst helper = new Helper(<DXF String>)\n\n// The 1-to-1 object representation of the DXF\nconsole.log('parsed:', helper.parsed)\n\n// Denormalised blocks inserted with transforms applied\nconsole.log('denormalised:', helper.denormalised)\n\n// Create an SVG\nconsole.log('svg:', helper.toSVG())\n\n// Create polylines (e.g. to render in WebGL)\nconsole.log('polylines:', helper.toPolylines())\n```\n\n## Running the Examples\n\nNode ES5. Will write an SVG to `examples/example.es5.svg`:\n\n```\n$ node examples/example.es5.js\n```\n\nNode ES6. Will write an SVG to `examples/example.es6.svg`:\n\n```\n$ npx babel-node examples/example.es6.js\n```\n\nBrowser. Compile to a browser bundle and open the example webpage:\n\n```\n$ npm run compile\n$ open examples/dxf.html\n```\n\n## SVG\n\nGeometric elements are supported, but dimensions, text, hatches and styles (except for line colors) are **_not_**.\n\nNative SVG elements are used as far as possible for curved entities (`<circle />`, `<ellipse/>` etc.), **_except for the SPLINE entity_**, which is interpolated.\n\nHere's an example you will find in the functional test output:\n\n![svg example image](https://cloud.githubusercontent.com/assets/57994/17583566/e00f5d78-5fb1-11e6-9030-55686f980e6f.png)\n\n## Interpolation\n\nThe library supports outputting DXFs as interpolated polylines for custom rendering (e.g. WebGL) or other applications, by using:\n\n```\n> helper.toPolylines()\n```\n\n## Command line\n\nThere is a command-line utility (courtesy of [@Joge97](https://github.com/Joge97)) for converting DXF files to SVG:\n\n```\n$ npm i -g dxf\n$ dxf-to-svg\n\n  Usage: dxf-to-svg [options] <dxfFile> [svgFile]\n\n  Converts a dxf file to a svg file.\n\n  Options:\n\n    -V, --version  output the version number\n    -v --verbose   Verbose output\n    -h, --help     output usage information\n```\n\n## Tests\n\nRunning\n\n`$ npm test`\n\nwill execute the unit tests.\n\n`$ npm run test:functional` will run the functional tests in a browser. Please open `toSVG.html` when the file listing loads in the browser (or open `http://localhost:8030/toSVG.html#/`).\n\n### Contributors\n\n- Liam Mitchell https://github.com/LiamKarlMitchell\n- Artur Zochniak https://github.com/arjamizo\n- Andy Werner https://github.com/Gallore\n- Ivan Baktsheev https://github.com/apla\n- Jeff Chen https://github.com/jeffontheground\n- Markko Paas https://github.com/markkopaas\n- Kim Lokøy https://github.com/klokoy\n- Erik Söhnel https://github.com/hoeck\n- Teja https://github.com/hungerpirat\n- Jakob Pallhuber https://github.com/Joge97\n- Eric Mansfield https://github.com/ericman314\n- Kristofer https://github.com/kriffe\n","readmeFilename":"README.md"}