# 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)

Latest version **9.0.4** (published 2020-11-12) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install now-client
pnpm add now-client
yarn add now-client
bun add now-client
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 9.0.4 |
| Published | 2020-11-12 |
| First published | 2016-08-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 11 |
| Unpacked size | 45.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 16272 |
| Maintainers | elsigh, leerobinson, hankvercel, okbel, samsisle, cleishm, nazarenooviedo, chibicode, gielcobben, jaredpalmer, jkrems, prateekbh, kikobeats, gmonaco, housseindjirdeh, developit, spanicker, keanulee, atcastle, janicklas-ralph, skllcrn, paco, guybedford, ragojose, williamli, msweeneydev, coetry, rabaut, lfades, mfix22, ijjk, arzafran, umegaya, timer, anatrajkovska, paulogdm, andybitz, mglagola, lucleray, zeit-bot, styfle, juancampa, dav-is, quietshu, joecohens, codetheory, matheuss, igorklopov, leo, nkzawa, tootallnate, rauchg, timneutkens, javivelasco, iamevilrabbit, timolins |

## Links

- npm: https://www.npmjs.com/package/now-client
- Repository: https://github.com/vercel/vercel
- Homepage: https://vercel.com
- Issues: https://github.com/vercel/vercel/issues
- npm.io page: https://npm.io/package/now-client

## Dependencies (11)

- [ms](https://npm.io/package/ms.md) 2.1.2
- [ignore](https://npm.io/package/ignore.md) 4.0.6
- [fs-extra](https://npm.io/package/fs-extra.md) 8.0.1
- [async-sema](https://npm.io/package/async-sema.md) 3.0.0
- [node-fetch](https://npm.io/package/node-fetch.md) 2.6.1
- [@zeit/fetch](https://npm.io/package/@zeit/fetch.md) 5.2.0
- [async-retry](https://npm.io/package/async-retry.md) 1.2.3
- [querystring](https://npm.io/package/querystring.md) ^0.2.0
- [sleep-promise](https://npm.io/package/sleep-promise.md) 8.0.1
- [recursive-readdir](https://npm.io/package/recursive-readdir.md) 2.2.2
- [@vercel/build-utils](https://npm.io/package/@vercel/build-utils.md) 2.6.0

## Recent versions

- 9.0.4 (latest) — 2020-11-12
- 9.0.5-canary.2 (canary) — 2020-12-14
- 9.0.5-canary.1 — 2020-12-11
- 9.0.5-canary.0 — 2020-11-17
- 9.0.4-canary.5 — 2020-11-11
- 9.0.4-canary.4 — 2020-11-10
- 9.0.4-canary.3 — 2020-11-09
- 9.0.4-canary.2 — 2020-11-09
- 9.0.4-canary.1 — 2020-11-05
- 9.0.4-canary.0 — 2020-10-26
- 9.0.3 — 2020-10-08
- 9.0.3-canary.0 — 2020-10-06
- 9.0.2 — 2020-09-21
- 9.0.2-canary.5 — 2020-09-16
- 9.0.2-canary.4 — 2020-09-11
- … 133 more at https://npm.io/package/now-client/versions

## README

# @vercel/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)

The official Node.js client for deploying to [Vercel](https://vercel.com).

## Usage

Firstly, install the package:

```bash
npm install @vercel/client
# or
yarn add @vercel/client
```

Next, load it:

```js
// v2
const { createDeployment } = require('@vercel/client');
// v1
const { createLegacyDeployment } = require('@vercel/client');
```

Then call inside a `for...of` loop to follow the progress with the following arguments:

- `<path>` - a directory path / file path / array of file paths (must be on the same level)
- `<options>` - An object containing `token`, an optional `teamId` and any `vercel.json`-valid [fields](https://vercel.com/docs/api#endpoints/deployments/create-a-new-deployment)

```js
async function deploy() {
  let deployment;

  for await (const event of createDeployment({
    token: process.env.TOKEN,
    path: '/Users/vercel-user/projects/front',
  })) {
    if (event.type === 'ready') {
      deployment = event.payload;
      break;
    }
  }

  return deployment;
}
```

Full list of events:

```js
[
  // File events
  'hashes-calculated',
  'file-count',
  'file-uploaded',
  'all-files-uploaded',
  // Deployment events
  'created',
  'building',
  'ready',
  'alias-assigned',
  'warning',
  'error',
];
```

You can also get the events set programmatically:

```js
import { EVENTS } from '@vercel/client';
```

---
_Source: https://npm.io/package/now-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
