@khulnasoft/client
TypeScript icon, indicating that this package has built-in type declarations

13.1.9 • Public • Published

@khulnasoft/client

Join the community on GitHub Discussions

The official Node.js client for deploying to Vercel.

Usage

Firstly, install the package:

npm install @khulnasoft/client

Next, load it:

const { createDeployment } = require('@khulnasoft/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/me/Code/myproject',
  })) {
    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 '@khulnasoft/client';

Readme

Keywords

none

Package Sidebar

Install

npm i @khulnasoft/client

Homepage

vercel.com

Weekly Downloads

1

Version

13.1.9

License

Apache-2.0

Unpacked Size

69.7 kB

Total Files

32

Last publish

Collaborators

  • nextlinux