Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
resource.all(function(err, rows){
if(err) {
logger.error(JSON.stringify(err))
return;
}
if (rows.length === 0) {
logger.info('no ' + resource.lowerResource.magenta + ' found')
} else {
logger.info('showing all ' + resource.lowerResource.magenta);
var lines = cliff.stringifyObjectRows(rows, Object.keys(resource.schema.properties), ['underline'], { columnSpacing: 5}).split('\n');
lines.forEach(function(line){
logger.info(line);
})
}
})
};
onComplete : function() {
console.log(cliff.stringifyObjectRows(
results,
['', 'mean time', 'ops/sec'],
['red', 'green', 'blue']) + '\n');
results = [];
}
});
onComplete() {
console.log('\n' + cliff.stringifyObjectRows(
results.sort((resultA, resultB) => resultA.mean - resultB.mean),
['', 'mean time', 'ops/sec'],
['', 'green', 'yellow']) + '\n');
}
}),
onComplete : function() {
console.log(cliff.stringifyObjectRows(
results,
['', 'mean time', 'ops/sec'],
['red', 'green', 'blue']) + '\n');
results = [];
}
}),
resource.all(function(err, rows){
if(err) {
logger.error(JSON.stringify(err))
return;
}
if (rows.length === 0) {
logger.info('no ' + resource.name.magenta + ' found')
} else {
var lines = cliff.stringifyObjectRows(rows, Object.keys(resource.schema.properties), ['underline'], { columnSpacing: 5 }).split('\n');
lines.forEach(function(line){
logger.info(line);
})
}
})
};
'bitrate',
'audio bitrate'
];
info.formats.forEach((format) => {
format['quality'] = format.qualityLabel;
format['bitrate'] = format.qualityLabel ?
util.toHumanSize(format.bitrate) : null;
format['audio bitrate'] = format.audioBitrate ?
format.audioBitrate + 'KB' : null;
cols.forEach((col) => {
format[col] = format[col] || '';
});
});
console.log(label('formats:'));
const colors = ['green', 'blue', 'green', 'blue', 'green', 'blue'];
console.log(cliff.stringifyObjectRows(info.formats, cols, colors));
});