How to use cliff - 10 common examples

To help you get started, we’ve selected a few cliff examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ezpaarse-project / ezpaarse / node_modules / forever / lib / forever.js View on Github external
if (format) {
    //
    // Iterate over the procs to see which has the
    // longest options string
    //
    procs.forEach(function (proc) {
      rows.push(mapColumns('[' + index + ']', function (column) {
        return forever.columns[column]
          ? forever.columns[column].get(proc)
          : 'MISSING';
      }));

      index++;
    });

    formatted = cliff.stringifyRows(rows, mapColumns('white', function (column) {
      return forever.columns[column]
        ? forever.columns[column].color
        : 'white';
    }));
  }

  return format ? formatted : procs;
};
github foreversd / forever / lib / forever.js View on Github external
if (format) {
    //
    // Iterate over the procs to see which has the
    // longest options string
    //
    procs.forEach(function (proc) {
      rows.push(mapColumns('[' + index + ']', function (column) {
        return forever.columns[column]
          ? forever.columns[column].get(proc)
          : 'MISSING';
      }));

      index++;
    });

    formatted = cliff.stringifyRows(rows, mapColumns('white', function (column) {
      return forever.columns[column]
        ? forever.columns[column].color
        : 'white';
    }));
  }

  return format ? formatted : procs;
};
github aredotna / ervell / node_modules / forever / lib / forever.js View on Github external
if (format) {
    //
    // Iterate over the procs to see which has the
    // longest options string
    //
    procs.forEach(function (proc) {
      rows.push(mapColumns('[' + index + ']', function (column) {
        return forever.columns[column]
          ? forever.columns[column].get(proc)
          : 'MISSING';
      }));

      index++;
    });

    formatted = cliff.stringifyRows(rows, mapColumns('white', function (column) {
      return forever.columns[column]
        ? forever.columns[column].color
        : 'white';
    }));
  }

  return format ? formatted : procs;
};
github node-pinus / pinus / packages / pinus / bin / commands / list.ts View on Github external
return 1;
                } else if (a.serverId < b.serverId) {
                    return -1;
                } else if (a.serverId > b.serverId) {
                    return 1;
                } else {
                    return 0;
                }
            };
            servers.sort(comparer);
            let rows: string[][] = [];
            rows.push(['serverId', 'serverType', 'pid', 'rss(M)', 'heapTotal(M)', 'heapUsed(M)', 'uptime(m)']);
            servers.forEach(function (server) {
                rows.push([server.serverId, server.serverType, server.pid, server.rss, server.heapTotal, server.heapUsed, server.uptime]);
            });
            console.log(cliff.stringifyRows(rows, ['red', 'blue', 'green', 'cyan', 'magenta', 'white', 'yellow']));
            process.exit(0);
        });
    });
github taskcluster / taskcluster / clients / client / bin / update-apis.js View on Github external
.action(function(name, options) {
    let api = apis[name];
    if (api === undefined) {
      console.log('No API named: ' + name);
      process.exit(1);
    }
    console.log(cliff.inspect(api));
  });
github tanepiper / nell / lib / plugins.js View on Github external
load_plugins(nell_site, function(err) {
      if (err) {
        return done(err);
      }

      Object.keys(nell_site.plugins_desc).forEach(function(plugin) {
        plugin = nell_site.plugins_desc[plugin];
        rows.push([plugin.key, plugin.args, plugin.desc]);
      });
      console.log(cliff.stringifyRows(rows, ['red', 'blue', 'green']));

      done(null);
    });
  }
github taskcluster / taskcluster / clients / client / bin / update-apis.js View on Github external
.action(function() {
    let rows = [
      ['Name', 'referenceUrl'],
    ].concat(_.keys(apis).map(function(name) {
      return [name, apis[name].referenceUrl];
    }));
    console.log(cliff.stringifyRows(rows));
  });
github DeviaVir / zenbot / commands / trade.js View on Github external
delete s.buy_order
                        delete s.sell_order
                        console.log('\nmanual'.grey + ' order cancel' + ' command executed'.grey)
                      } else if (key === 'm' && !info.ctrl && so.mode === 'live') {
                        so.manual = !so.manual
                        console.log('\nMANUAL trade in LIVE mode: ' + (so.manual ? 'ON'.green.inverse : 'OFF'.red.inverse))
                      } else if (key === 'T' && !info.ctrl) {
                        so.order_type = 'taker'
                        console.log('\n' + 'Taker fees activated'.bgRed)
                      } else if (key === 'M' && !info.ctrl) {
                        so.order_type = 'maker'
                        console.log('\n' + 'Maker fees activated'.black.bgGreen)
                      } else if (key === 'o' && !info.ctrl) {
                        listOptions()
                      } else if (key === 'O' && !info.ctrl) {
                        console.log('\n' + cliff.inspect(so))
                      } else if (key === 'P' && !info.ctrl) {
                        console.log('\nWriting statistics...'.grey)
                        printTrade(false)
                      } else if (key === 'X' && !info.ctrl) {
                        console.log('\nExiting... ' + '\nWriting statistics...'.grey)
                        printTrade(true)
                      } else if (key === 'd' && !info.ctrl) {
                        console.log('\nDumping statistics...'.grey)
                        printTrade(false, true)
                      } else if (key === 'D' && !info.ctrl) {
                        console.log('\nDumping statistics...'.grey)
                        toggleStats()
                      } else if (key === 'L' && !info.ctrl) {
                        debug.flip()
                        console.log('\nDEBUG mode: ' + (debug.on ? 'ON'.green.inverse : 'OFF'.red.inverse))
                      } else if (info.name === 'c' && info.ctrl) {
github beaugunderson / ip-address / bin / ipv6.js View on Github external
cli.withStdinLines(function (lines) {
  for (var i = 0; i < lines.length; i++) {
    if (lines[i] === '') {
      continue;
    }

    var address = new v6.Address(lines[i]);

    if (options.v) {
      this.output(sprintf('%s = %s\n', lines[i], cliff.inspect(address)));
    } else if (options.c) {
      rows.push([
        lines[i],
        address.isValid() ? 'Yes' : 'No'.red,
        address.isValid() ? address.correctForm() : '',
        address.isValid() ? address.canonicalForm() : ''
      ]);
    } else {
      this.output(sprintf('%s,%s\n', lines[i], address.isValid() ? 'valid' : 'invalid'));
    }
  }

  if (options.c) {
    console.log(cliff.stringifyRows(rows, ['green', 'green', 'green', 'green']));
  }
});
github aredotna / ervell / node_modules / forever / lib / forever / cli.js View on Github external
app.cmd('config', cli.config = function () {
  var keys = Object.keys(forever.config.store),
      conf = cliff.inspect(forever.config.store);

  if (keys.length <= 2) {
    conf = conf.replace(/\{\s/, '{ \n')
               .replace(/\}/, '\n}')
               .replace('\\033[90m', '  \\033[90m')
               .replace(/, /ig, ',\n  ');
  }
  else {
    conf = conf.replace(/\n\s{4}/ig, '\n  ');
  }

  conf.split('\n').forEach(function (line) {
    forever.log.data(line);
  });
});

cliff

Your CLI formatting friend.

MIT
Latest version published 10 years ago

Package Health Score

56 / 100
Full package analysis