A very lightweight utility to make interacting with Hashicorp's Packer easier
Allow simple interaction with Packer from Node. Inspired by node-packer. If you need a more complete solution you may want to take a look at that module.
npm install cb-packer --save
var file = new PackerFile();
file.Read('./filename.json', function() {
console.log(file.variables.variable1);
file.variables.variable2 = 'new value';
});
file.Write('./newFileName.json', function() {
console.log('File saved.');
});
file.on('stdout', function(data) {
console.log(`${data}`);
});
file.on('stderr', function(data) {
console.error(`${data}`);
});
file.on('error', function(data) {
console.error(`${data}`);
});
file.Run(function(artifacts) {
console.log(`First artifact ID: ${artifacts[0].id}`);
});