How to use cli-spinner - 10 common examples

To help you get started, we’ve selected a few cli-spinner 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 google / clasp / index.js View on Github external
FS_FILE_WRITE: 'Could not write file.',
  LOGGED_IN: `You seem to already be logged in. Did you mean to 'logout'?`,
  LOGGED_OUT: `Please login. (${PROJECT_NAME} login)`,
  ONE_DEPLOYMENT_CREATE: 'Currently just one deployment can be created at a time.',
  READ_ONLY_DELETE: 'Unable to delete read-only deployment.',
  PERMISSION_DENIED: `Error: Permission denied. Enable the Apps Script API:
https://script.google.com/home/usersettings`,
  SCRIPT_ID: '\n> Did you provide the correct scriptId?\n',
  SCRIPT_ID_DNE: `No ${DOT.PROJECT.PATH} settings found. \`create\` or \`clone\` a project first.`,
  SCRIPT_ID_INCORRECT: (scriptId) => `The scriptId "${scriptId}" looks incorrect.
Did you provide the correct scriptId?`,
  UNAUTHENTICATED: 'Error: Unauthenticated request: Please try again.',
};

// Utils
const spinner = new Spinner();

/**
 * Logs errors to the user such as unauthenticated or permission denied
 * @param  {Object} err         The object from the request's error
 * @param  {string} description The description of the error
 */
const logError = (err, description) => {
  // Errors are weird. The API returns interesting error structures.
  // TODO(timmerman) This will need to be standardized. Waiting for the API to
  // change error model. Don't review this method now.
  if (err && typeof err.error === 'string') {
    console.error(JSON.parse(err.error).error);
  } else if (err && err.statusCode === 401 || err && err.error && err.error.error && err.error.error.code === 401) {
    console.error(ERROR.UNAUTHENTICATED);
  } else if (err && (err.error && err.error.code === 403 || err.code === 403)) {
    console.error(ERROR.PERMISSION_DENIED);
github t4t5 / november-cli / actions / new-project.js View on Github external
if (!projectName) {
    return nov.logErr("You need to specify a name for your project");
  }

  if (nov.novemberDir()) {
    userArgs.shift();
    return nov.logErr("You're trying to create a new November project inside an existing one! Did you mean to use `november generate " + userArgs.join(' ') + "?");
  }

  // Check if the folder already exists
  try {
    stats = fs.lstatSync(projectName);
    return nov.logErr("There's already a project with the name " + projectName + " in this directory!");
  }
  catch (e) {
    var spinner = new Spinner('%s Building November project...');

    // Copy the contents of the blueprint folder to the user's app folder 
    ncp.ncpAsync(path.resolve(__dirname, '../template-files/blueprint-project'), projectName)
    .then(function() {
      return fs.readFileAsync(projectName + '/package.json', 'utf8');
    })
    // Set the name of the app in package.json
    .then(function(packageJsonContents) {
      packageJsonContents = nov.fillTemplatePlaceholders(packageJsonContents, projectName);
      return fs.writeFileAsync(projectName + '/package.json', packageJsonContents, 'utf8');
    })
    .then(function() {
      return fs.readFileAsync(projectName + '/public/index.html', 'utf8');
    })
    // Set the name of the app in index.html
    .then(function(htmlContents) {
github pickware / scs-commander / lib / shopware_store_client.js View on Github external
constructor(username, password) {
        this.baseURL = 'https://api.shopware.com/';
        this.username = username;
        this.password = password;
        // Prepare the loading spinner
        this.spinner = new Spinner();
        this.spinner.setSpinnerString(11);
    }
github WhirIO / Client / app / core / whir.js View on Github external
.then((headers) => {
        if (headers.error) {
          throw headers.error;
        }

        console.log();
        this.spinner = new Spinner(' %s Connecting...');
        this.spinner.setSpinnerString(18);
        this.spinner.start();
        return this.connect(headers);
      })
      .catch((error) => this.emit('error', error));
github orionsoft / react-deploy-s3 / src / deploy / build.js View on Github external
export default async () => {
  let spinner = new Spinner('%s Building app...')
  spinner.setSpinnerString('⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏')
  spinner.start()

  await exec('npm run build')

  spinner.stop(true)

  console.log(clc.bold('App built'))
}
github roccomuso / kickthemout / lib / vendors.js View on Github external
exports.ouiUpdate = function (cb) {
  console.log(chalk.yellow('  This task could take up to 5 minutes...'))
  const spinner = new Spinner('  Updating MAC Vendors DB.. %s')
  spinner.setSpinnerString('|/-\\')
  spinner.start()

  oui.update({}, function (err) {
    spinner.stop()
    if (err) return cb(err)
    cb(null, chalk.green('\n \u2713 MAC Vendors DB updated!'))
  })
}
github gagarinjs / meteor-mocha / packages / gagarin-mocha-cli / lib / index.js View on Github external
function initialize(remote, runTestsManually) {
  if (initialized) {
    return;
  }
  initialized = true;

  var endpoint = remote || 'ws://127.0.0.1:' + argv.port + '/websocket';
  var Asteroid = createClass();
  var asteroid = new Asteroid({
    endpoint: endpoint,
    SocketConstructor: WebSocket.Client,
    reconnectInterval: 2000,
  });

  var receiver;
  var spinner = new Spinner('  waiting for server... %s');

  asteroid.subscribe('Gagarin.Reports.all');
  asteroid.on('connected', function () {
    if (!argv.once) {
      spinner.stop();
    }
    if (runTestsManually) {
      asteroid
        .call('Gagarin.runTests')
        .catch(function (err) {
          console.error(err);
        });
    }
  });

  asteroid.on('disconnected', function () {
github CalvinVon / dalao-proxy / src / commands / plugin-manager.command / view.command / view-package.js View on Github external
function displayViewPlugin(packageName, installedPlugins, options) {
    const isInstalled = installedPlugins.filter(plugin => plugin.id === packageName)[0];
    const spinner = new Spinner('Requesting from the npm package registry ... %s');
    spinner.start();
    fetchPackageInfo(packageName, options, (err, packageDetail) => {
        if (err) return exitProgram(err);
        console.clear();

        fetchPkgMonthlyDownloadCount(packageName, (err, count) => {
            spinner.stop(true);
            packageDetail.lastMonDownload = count;

            if (isInstalled) {
                packageDetail.installed = true;
                packageDetail.currentVersion = isInstalled.meta.version;
            }

            displayDetailTable({
                package: packageDetail,
github mapbox / ecs-watchbot / bin / dead-letter.js View on Github external
async function returnMany(sqs, queueUrl, handles) {
  const spinner = new Spinner(`Returning ${handles.length} jobs to the queue...`);
  spinner.setSpinnerString('⠄⠆⠇⠋⠙⠸⠰⠠⠰⠸⠙⠋⠇⠆');
  spinner.start();

  const queue = new Queue({ concurrency: 10 });
  const returns = handles.map((handle) => queue.add(() => returnOne(sqs, queueUrl, handle)));
  const returnManyResult = await Promise.all(returns);
  spinner.stop(true);
  return returnManyResult;
}
github hyron-group / hyron / core / appLoader.js View on Github external
childProcess.exec("yarn version", (err) => {
        var spinner = new Spinner("install yarn ...%s");
        if (err != null) {
            spinner.setSpinnerString(0);
            spinner.start();
            childProcess.execSync("npm i -g yarn");
            spinner.stop();
        }
    });
})();

cli-spinner

A simple spinner

MIT
Latest version published 5 years ago

Package Health Score

56 / 100
Full package analysis

Popular cli-spinner functions