-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest
executable file
·38 lines (35 loc) · 1007 Bytes
/
test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env node
const fs = require("fs");
const pcbStackupZip = require("./index");
const url =
process.argv[2] ||
"https://kitspace.org/boards/github.com/kasbah/push-on-hold-off/push-on-hold-off-1767c8a-gerbers.zip";
console.log(`fetching ${url}`);
pcbStackupZip({
remote: url
}, {
solderMask: "white",
silkScreen: "black",
copperFinish: "gold",
}).then(out => {
console.log("board_width:", out.board_width);
console.log("board_length:", out.board_length);
console.log("board_layers:", out.board_layers);
console.log("tools:", out.tools);
console.log("writing top.svg");
fs.writeFile("top.svg", out.stackup.top.svg, err => {
if (err) {
console.error("ERROR writing top.svg");
console.error(err);
process.exit(1);
}
});
console.log("writing bottom.svg");
fs.writeFile("bottom.svg", out.stackup.bottom.svg, err => {
if (err) {
console.error("ERROR writing bottom.svg");
console.error(err);
process.exit(1);
}
});
});