Fix formatting and add a few comments
This commit is contained in:
parent
2b38c1256b
commit
0b41a4e56f
7
index.js
7
index.js
@ -1,10 +1,13 @@
|
|||||||
|
//Modules
|
||||||
const AdmZip = require('adm-zip');
|
const AdmZip = require('adm-zip');
|
||||||
const fs = require('fs-extra');
|
const fs = require('fs-extra');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const pcbStackup = require('pcb-stackup');
|
const pcbStackup = require('pcb-stackup');
|
||||||
const sharp = require('sharp');
|
const sharp = require('sharp');
|
||||||
const { Readable } = require('stream');
|
const { Readable } = require('stream');
|
||||||
|
const { Buffer } = require('node:buffer');
|
||||||
|
|
||||||
|
//Class definition
|
||||||
class ImageGenerator {
|
class ImageGenerator {
|
||||||
constructor(folderConfig, imgConfig, layerNames) {
|
constructor(folderConfig, imgConfig, layerNames) {
|
||||||
this.tmpDir = folderConfig.tmpDir;
|
this.tmpDir = folderConfig.tmpDir;
|
||||||
@ -121,7 +124,7 @@ class ImageGenerator {
|
|||||||
ImageGenerator.extractArchive(gerber, this.tmpDir);
|
ImageGenerator.extractArchive(gerber, this.tmpDir);
|
||||||
ImageGenerator.getLayers(
|
ImageGenerator.getLayers(
|
||||||
path.join(this.tmpDir, 'archive'),
|
path.join(this.tmpDir, 'archive'),
|
||||||
this.layerNames
|
this.layerNames,
|
||||||
)
|
)
|
||||||
.then(pcbStackup)
|
.then(pcbStackup)
|
||||||
.then((stackup) => {
|
.then((stackup) => {
|
||||||
@ -169,7 +172,7 @@ class ImageGenerator {
|
|||||||
ImageGenerator.extractArchive(gerber, this.tmpDir);
|
ImageGenerator.extractArchive(gerber, this.tmpDir);
|
||||||
ImageGenerator.getLayers(
|
ImageGenerator.getLayers(
|
||||||
path.join(this.tmpDir, 'archive'),
|
path.join(this.tmpDir, 'archive'),
|
||||||
this.layerNames
|
this.layerNames,
|
||||||
)
|
)
|
||||||
.then(pcbStackup)
|
.then(pcbStackup)
|
||||||
.then((stackup) => {
|
.then((stackup) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user