Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
]).on("list", action => {
cowsay.list((err, list) => {
if (err) { return this.exit(err); }
let str = list.join(action.options.list.is_provided ? "\n" : ", ")
console.log(str);
});
}).main(action => {
console.log(cowsay.say({
handlers.enable = function(cb) {
cowsay.list(function(err, result) {
cows = _.difference(result, config.blacklist || []);
if (!err) {
_.forEach(cows, function (cow) {
cowsay.say({f: cow, text: 'a'});
});
cows.sort(function(a, b) {
function determineScore(v) {
switch (v) {
case 'default': return -3;
case 'tux': return -2;
case 'sheep': return -1;
default: return v.length;
}
}
var scoreDelta = determineScore(a) - determineScore(b);
if (scoreDelta) return scoreDelta;