How to use the progress function from cli
Find comprehensive JavaScript cli.progress code examples handpicked from public code repositorys.
GitHub: node-js-libs/cli
0 1 2 3 4 5 6 7 8 9
#!/usr/bin/env node var cli = require('cli'); var i = 0, interval = setInterval(function () { cli.progress(++i / 100); if (i === 100) { clearInterval(interval); cli.ok('Finished!'); }
79
799
21
GitHub: sunny/craster
50 51 52 53 54 55 56 57
craster.capture( options, cli.debug, cli.fatal, !options['no-progress'] && cli.progress ) })
3
14
3
+ 3 other calls in file
GitHub: simontabor/serenity
80 81 82 83 84 85 86 87 88 89
var self = this; var ejsFiles = files.filter(function(f) { return f.slice(-4) === '.ejs'; }); var otherFiles = files.filter(function(f) { return ejsFiles.indexOf(f) === -1; }); if (files.length > 1) cli.progress(0); var doneCount = 0; var processGroup = function(group, done) {
3
13
2
+ 3 other calls in file
GitHub: unfoldingWord-box3/tact
8 9 10 11 12 13 14 15 16 17
first: ['f', 'first input line to use', 'int', 0], count: ['n', 'limit input to n lines', 'int', 20] }) function progress(percent) { cli.progress(percent) } tact.corpus.parseFiles(options.sourceFile, options.targetFile, function(alignmentPairs) { alignmentPairs = alignmentPairs.slice(options.first,options.first+options.count)
4
3
2
GitHub: wtelecom/intrepidjs-web
46 47 48 49 50 51 52 53 54 55
fs.readdir(dir, function(err, list) { if (err) return done(err); var i = 0; (function next() { progress += 0.01; cli.progress(progress); var file = list[i++]; if (!file) return done(null, results); fileToRead = dir + '/' + file; setTimeout(function(){
2
2
14
+ 3 other calls in file
GitHub: rutaihwa/babu
29 30 31 32 33 34 35 36 37 38
// Update app package.json var Package = Fs.readJsonSync(Path.join(destination, 'package.json')); // Cli.progress(0.3); Package.name = name; Package.version = '0.0.1'; Package.description = 'A cool project started to be built by babu';
0
2
3
+ 15 other calls in file