How to use now-client - 4 common examples

To help you get started, we’ve selected a few now-client 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 zeit / now / packages / now-cli / src / util / deploy / process-deployment.ts View on Github external
const nowClientOptions: NowClientOptions = {
    teamId: now.currentTeam,
    apiUrl: now._apiUrl,
    token: now._token,
    debug: now._debug,
    userAgent: ua,
    path: paths[0],
    force,
  };

  if (!isLegacy) {
    let queuedSpinner = null;
    let buildSpinner = null;
    let deploySpinner = null;

    for await (const event of createDeployment(
      nowClientOptions,
      requestBody,
      nowConfig
    )) {
      if (event.type === 'hashes-calculated') {
        hashes = event.payload;
      }

      if (event.type === 'warning') {
        warn(event.payload);
      }

      if (event.type === 'notice') {
        note(event.payload);
      }
github zeit / now / packages / now-cli / src / util / deploy / process-deployment.ts View on Github external
if (event.type === 'alias-assigned') {
        if (queuedSpinner) {
          queuedSpinner();
        }
        if (buildSpinner) {
          buildSpinner();
        }
        if (deploySpinner) {
          deploySpinner();
        }

        return event.payload;
      }
    }
  } else {
    for await (const event of createLegacyDeployment(
      nowClientOptions,
      requestBody,
      nowConfig
    )) {
      if (event.type === 'hashes-calculated') {
        hashes = event.payload;
      }

      if (event.type === 'file_count') {
        debug(
          `Total files ${event.payload.total.size}, ${event.payload.missing.length} changed`
        );
        if (!quiet) {
          log(
            `Synced ${pluralize(
              'file',

now-client

[![Join the community on GitHub Discussions](https://badgen.net/badge/join%20the%20discussion/on%20github/black?icon=github)](https://github.com/vercel/vercel/discussions)

Apache-2.0
Latest version published 4 years ago

Package Health Score

56 / 100
Full package analysis