Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const output = renderTemplate(chunk.toString());
done(null, output);
});
}
};
try {
await copy(templatesPath, dirPath, options)
.on(copy.events.COPY_FILE_START, copyOperation => {
console.log(`Generate ${copyOperation.dest}...`);
});
} catch (error) {
showError(`Generate failed: ${error}\nPlease clean current directory and retry !`);
}
PImage.encodeJPEGToStream(
createCover(name),
fs.createWriteStream(path.resolve(dirPath, 'cover.jpg'))
);
}
ctx.fillText('Creator:', this.marginLeft, this.getPosY())
ctx.fillText(this.metadata.creator, this.marginLeft, this.getPosY())
ctx.fillText('', this.marginLeft, this.getPosY())
ctx.fillText('Date Modified:', this.marginLeft, this.getPosY())
ctx.fillText(this.metadata['date-modified'], this.marginLeft, this.getPosY())
ctx.fillText('', this.marginLeft, this.getPosY())
ctx.fillText('Identifier:', this.marginLeft, this.getPosY())
ctx.fillText(this.metadata.identifier, this.marginLeft, this.getPosY())
ctx.fillText('', this.marginLeft, this.getPosY())
ctx.fillText('b-ber version', this.marginLeft, this.getPosY())
ctx.fillText(state.version, this.marginLeft, this.getPosY())
return PureImage.encodeJPEGToStream(img, fs.createWriteStream(this.coverImagePath))
.then(() => {
log.info('cover generated image [%s]', this.coverImagePath)
resolve()
})
.catch(log.error)
})
})