Miss any of our Open RFC calls?Watch the recordings here! »

This package has been deprecated

Author message:

"now-client" is deprecated and will stop receiving updates on December 31, 2020. Please use "@vercel/client" instead.

now-client

9.0.2 • Public • Published

@vercel/client

Join the community on GitHub Discussions

The official Node.js client for deploying to Vercel.

Usage

Firstly, install the package:

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

Next, load it:

// 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
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:

[
  // 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:

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

Keywords

none

Install

npm i now-client

DownloadsWeekly Downloads

2,506

Version

9.0.2

License

MIT

Unpacked Size

46.5 kB

Total Files

28

Homepage

vercel.com

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar