gerber-to-svg
Advanced tools
Comparing version 0.2.3 to 0.2.4
(function() { | ||
var BANNER, OPTIONS, VERSION, chalk, fs, gerberToSvg, getOptions, help, parseArgs, path, printOptions, run, stderr, streamCapture, version, | ||
var BANNER, BOOLEAN_OPTS, OPTIONS, STRING_OPTS, VERSION, chalk, fs, gerberToSvg, getOptions, help, parseArgs, path, printOptions, run, stderr, streamCapture, version, | ||
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; | ||
@@ -40,4 +40,8 @@ | ||
OPTIONS = [['o', 'out', ' specify an output directory'], ['q', 'quiet', ' do not print warnings and messages'], ['p', 'pretty', ' align SVG output prettily'], ['d', 'drill', ' process following file as an NC (Excellon) drill file'], ['a', 'append-ext', ' append .svg rather than replace the extension'], ['v', 'version', ' display version information'], ['h', 'help', ' display this help text']]; | ||
OPTIONS = [['o', 'out', ' specify an output directory'], ['q', 'quiet', ' do not print warnings and messages'], ['p', 'pretty', ' align SVG output prettily'], ['d', 'drill', ' process following file as an NC (Excellon) drill file'], ['a', 'append-ext', ' append .svg rather than replace the extension'], ['j', 'json', ' output json rather than an xml string'], ['v', 'version', ' display version information'], ['h', 'help', ' display this help text']]; | ||
STRING_OPTS = ['out', 'drill']; | ||
BOOLEAN_OPTS = ['quiet', 'pretty', 'append-ext', 'json', 'version', 'help']; | ||
printOptions = function() { | ||
@@ -77,3 +81,5 @@ var o, _i, _len, _results; | ||
argv = parseArgs(process.argv.slice(2), { | ||
alias: getOptions() | ||
alias: getOptions(), | ||
string: STRING_OPTS, | ||
boolean: BOOLEAN_OPTS | ||
}); | ||
@@ -99,2 +105,5 @@ fileList = argv._; | ||
var newName; | ||
if (typeof string === 'object') { | ||
string = JSON.stringify(string, null, (argv.pretty ? ' ' : '')); | ||
} | ||
if (!argv.out) { | ||
@@ -132,3 +141,4 @@ return process.stdout.write(string); | ||
pretty: argv.pretty, | ||
drill: file === argv.drill | ||
drill: file === argv.drill, | ||
object: argv.json | ||
}; | ||
@@ -135,0 +145,0 @@ return write(gerberToSvg(data, opts), file); |
{ | ||
"name": "gerber-to-svg", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"description": "Gerber and NC drill file to SVG converter", | ||
@@ -5,0 +5,0 @@ "main": "lib/gerber-to-svg.js", |
@@ -24,2 +24,3 @@ # gerber-to-svg [![Build Status](http://img.shields.io/travis/mcous/gerber-to-svg.svg?style=flat)](https://travis-ci.org/mcous/gerber-to-svg) [![Coverage](http://img.shields.io/coveralls/mcous/gerber-to-svg.svg?style=flat)](https://coveralls.io/r/mcous/gerber-to-svg) [![Version](http://img.shields.io/npm/v/gerber-to-svg.svg?style=flat)](https://www.npmjs.org/package/gerber-to-svg) | ||
`-a, --append-ext` | append .svg rather than replace the old file extension | ||
`-j, --json` | output the SVG in JSON rather than as an XML string | ||
`-v, --version` | display version information | ||
@@ -26,0 +27,0 @@ `-h, --help` | display help text |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
191868
5060
177