How to use cliui - 2 common examples

To help you get started, we’ve selected a few cliui 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 yitzchak / dicy / src / ouroboros-cli.js View on Github external
#! /usr/bin/env node
/* @flow */

import 'babel-polyfill'
import _ from 'lodash'
import chalk from 'chalk'
import path from 'path'
import program from 'commander'
import cliui from 'cliui'

import { Ouroboros, File } from './main'

const ui = cliui({ width: 80 })

function parseStrings (value) {
  return value.split(/\s*,\s*/)
}

function parseNumber (value) {
  return parseInt(value, 10)
}

function parseNumbers (value) {
  return parseStrings(value).map(x => parseNumber(x))
}

function cloneOptions (options) {
  const newOptions = {}
github bustle / shep / src / run / index.js View on Github external
import path from 'path'
import requireProject from '../util/require-project'
import * as load from '../util/load'
import build from '../util/build-functions'
import Promise from 'bluebird'
import chalk from 'chalk'
import ctx from '../util/context'
import cliui from 'cliui'

const ui = cliui({ width: 80 })

const results = { success: 'SUCCESS', error: 'ERROR', exception: 'EXCEPTION' }

const awsNodeVersion = ['4.3.2', '6.10.2']

export default async function (opts) {
  const logger = opts.logger || (() => {})
  const processVersion = process.versions.node

  if (awsNodeVersion.indexOf(processVersion) === -1) {
    logger(`Warning: Lambda currently runs node v${awsNodeVersion} but you are using v${processVersion}`)
  }

  const loggingFunction = logFunction(opts.t)
  const funcRunner = runFunction(opts)
  const names = await load.funcs(opts.pattern)

cliui

easily create complex multi-column command-line-interfaces

ISC
Latest version published 2 years ago

Package Health Score

77 / 100
Full package analysis

Popular cliui functions