-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathREADME.hbs
43 lines (33 loc) · 1006 Bytes
/
README.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# 𝚫 now client [](https://travis-ci.org/zeit/now-client)
Node.js module to interact with the official [𝚫 now API](https://zeit.co/api).
You need to provide your API token, which you can obtain [here](https://zeit.co/account#api-tokens).
It is possible to pass it as a parameter or with the `NOW_TOKEN` environment variable.
When no token is given, it will use the one contained in your `~/.now.json` file.
```sh
npm install --save now-client
```
## Example
```js
const Now = require('now-client')
const now = Now('YOUR TOKEN')
// Supports Promises
now.getDeployments().then(deployments => {
console.log(deployments)
}).catch(err => {
console.error(err)
})
// Or go old-school with callbacks
now.getDeployments((err, deployments) => {
if (err) {
console.error(err)
return
}
console.log(deployments)
})
```
## API Reference
{{#class name="Now"~}}
{{>body~}}
{{>member-index~}}
{{>members~}}
{{/class}}