mcous / gerber-parser

gerber-parser development moved to tracespace/tracespace
https://github.com/tracespace/tracespace
MIT License
16 stars 11 forks source link

repository deprecated

Development of gerber-parser has moved to tracespace/tracespace!

gerber parser

npm Travis Coveralls David David

A printed circuit board Gerber and drill file parser. Implemented as a Node transform stream that takes a Gerber text stream and emits objects to be consumed by some sort of PCB plotter.

how to

$ npm install gerber-parser

var fs = require("fs");
var gerberParser = require("gerber-parser");

var parser = gerberParser();
parser.on("warning", function(w) {
  console.warn("warning at line " + w.line + ": " + w.message);
});

fs.createReadStream("/path/to/gerber/file.gbr")
  .pipe(parser)
  .on("data", function(obj) {
    console.log(JSON.stringify(obj));
  });

To run in the browser, this module should be bundled with a tool like browserify or webpack.

api

See API.md

developing and contributing

Tests are written in Mocha and run in Node and a variety of browsers with Zuul and Open Sauce. All PRs should be accompanied by unit tests, with ideally one feature / bugfix per PR. Code is linted with ESLint.

Code is deployed on tags via TravisCI and code coverage is tracked with Coveralls.

build scripts

deploying

The module is published to npm automatically by Travis if the commit is tagged (and tests pass). To deploy:

  1. $ npm version ... - Use the npm version command to bump the version and tag the commit
  2. $ git push --tags - Push the tag to trigger a build