@vercel/client
v9.0.9-canary.6@vercel/client
The official Node.js client for deploying to Vercel.
Usage
Firstly, install the package:
npm install @vercel/client
Next, load it:
const { createDeployment } = 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 containingtoken
, an optionalteamId
and anyvercel.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 '@vercel/client';
npm i @vercel/[email protected]
Metadata
- MIT
- >= 12
- Unknown
- released 4/14/2021
Downloads
Maintainers
mrmckeb, jhoch, ismaelrumzan, ernestd, rizbizkits, chriswdmr, coetry, samsisle, cl3arglass, divmain, raunofreiberg, elsigh, timneutkens, leo, chibicode, ijjk, andybitz, iamevilrabbit, joecohens, tootallnate, styfle, zeit-bot, quietshu, hankvercel, mglagola, javivelasco, igorklopov, paco, dav-is, timer, lucleray, leerobinson, matheuss, nkzawa, anatrajkovska,