@vercel/client
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:
// v2const createDeployment = ;// v1const createLegacyDeployment = ;
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 containingtoken
, an optionalteamId
and anyvercel.json
-valid fields
{ let deployment; for await const event of if eventtype === 'ready' deployment = eventpayload; 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:
;