How to use the debug function from cli

Find comprehensive JavaScript cli.debug code examples handpicked from public code repositorys.

40
41
42
43
44
45
46
47
48
49
    resolve({listTitle: data.listTitle, trackList});
  } catch (error) {
    reject(`Error while parsing the list of tracks on the provided link`);
  }
})
.log(message => { process.env.DEBUG && cli.debug(message); })
.error(err => {
  if (err.match(/no results/))
    reject("Couldn't find any tracks on the provided link")
  else
fork icon20
star icon108
watch icon4

52
53
54
55
56
57
58
59
60
61
 */
function error(err) {
    cli.error('////////////////////////////////////////////////////////////////////////////////');
    cli.error(err);
    if (err.stack) {
        cli.debug(err.stack);
    }
    cli.error('////////////////////////////////////////////////////////////////////////////////');
    cli.getUsage(1);
}
fork icon0
star icon6
watch icon0

+ 3 other calls in file

79
80
81
82
83
84
85
86
87
 */
function mainCb(args, options) {

    // CLI debug

    cli.debug('application: ' + cli.app);
    cli.debug('parsed args: ' + JSON.stringify(args, null, 4));
    cli.debug('parsed options: ' + JSON.stringify(options, null, 4));
    cli.debug('raw process args: ' + JSON.stringify(process.argv, null, 4));
fork icon0
star icon2
watch icon2

+ 31 other calls in file

108
109
110
111
112
113
114
115
116
117
        });
    });
}

function installPackage(descriptor, options, packageDir, fromLocal) {
    cli.debug("got descriptor" + util.inspect(descriptor));
    var installTo = options.installDir + path.sep + descriptor.id;
    if (fs.existsSync(installTo)) {
        throw new Error("already have existing package at " + installTo);
    }
fork icon0
star icon0
watch icon12

+ 23 other calls in file