All Projects → zeit → Now Client

zeit / Now Client

A JavaScript wrapper for the Now Instant API

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Now Client

Now Builders
Official Now Builders created by the ZEIT team
Stars: ✭ 483 (+142.71%)
Mutual labels:  now, zeit
Now Logs
realtime logging for now - https://logs.now.sh
Stars: ✭ 103 (-48.24%)
Mutual labels:  now, zeit
Jwt Example
Playing with user registration, login/logout, auth, etc using JWTs, serverless functions & faunadb as the data store.
Stars: ✭ 22 (-88.94%)
Mutual labels:  now, zeit
Micro Proxy
[DEPRECATED] Simplest proxy server for microservices
Stars: ✭ 358 (+79.9%)
Mutual labels:  now, zeit
Create React App Now
Hello, create-react-app, meet Zeit's awesome now.sh service.
Stars: ✭ 137 (-31.16%)
Mutual labels:  now, zeit
Vercel Php
▲ Vercel PHP runtime • vercel-php • now-php • 🐘+ λ = ❤
Stars: ✭ 429 (+115.58%)
Mutual labels:  now, zeit
Now Storage
Use Now static deployments to upload and store files.
Stars: ✭ 91 (-54.27%)
Mutual labels:  now, zeit
notion-custom-domain
📝 Custom domains for your public Notion pages
Stars: ✭ 23 (-88.44%)
Mutual labels:  now, zeit
Nextjs Vercel Firebase
Next.js app using API routes to connect with Firestore.
Stars: ✭ 133 (-33.17%)
Mutual labels:  now, zeit
Stage Ci
Automatic deploy previews for your PRs using zeit.co/now.
Stars: ✭ 132 (-33.67%)
Mutual labels:  now, zeit
Meteor Now
Instantly deploy your Meteor apps with `meteor-now`
Stars: ✭ 339 (+70.35%)
Mutual labels:  now, zeit
Vercel Rust
Community based builder for using rust on the now/zeit platform
Stars: ✭ 168 (-15.58%)
Mutual labels:  now, zeit
Covid19 Brazil Api
API com dados atualizados sobre o status do COVID-19 🦠
Stars: ✭ 300 (+50.75%)
Mutual labels:  now, zeit
Vercel Builder
Vercel Builder for Nuxt.js
Stars: ✭ 437 (+119.6%)
Mutual labels:  now, zeit
now-course
Proyecto para el curso de Now.sh en Platzi
Stars: ✭ 19 (-90.45%)
Mutual labels:  now, zeit
Now Clear
A utility to delete all zeit now instances that aren't aliased
Stars: ✭ 12 (-93.97%)
Mutual labels:  now, zeit
now dashboard
▲ZEIT dashboard written in elm
Stars: ✭ 52 (-73.87%)
Mutual labels:  now, zeit
now-docs
[WIP] Deploy docs with a single command using Now
Stars: ✭ 45 (-77.39%)
Mutual labels:  now, zeit
Deploy.now
One click deploys to △ now
Stars: ✭ 121 (-39.2%)
Mutual labels:  now, zeit
Micro Medium Api
Microservice for fetching the latest posts of Medium with GraphQL.
Stars: ✭ 138 (-30.65%)
Mutual labels:  now, zeit

now client


DEPRECATED: Read more here.


Build Status XO code style Slack Channel

The official JavaScript client for interacting with the now instant API (please note that this API only allows you to send strings, it doesn't support streaming - but binary files can be encoded as base64 strings).

Usage

Firstly, install the package using npm:

npm install --save now-client

Next, load it:

const NowClient = require('now-client')

Then initialize it:

  • <token> holds your token, which can obtained here (optional, will read from ~/.now/auth.json if not defined - you can also define it using the NOW_TOKEN environment variable)
  • <team> specifies the ID of the team to which the actions should apply (optional)
const now = new NowClient(<token>, <team>)

And finally, you can use its methods to retrieve data:

await now.getDeployments()

API Reference

Kind: global class

new Now([token])

Initializes the API. Looks for token in ~/.now.json if none is provided.

Param Type Description
[token] String Your now API token.

now.getDeployments([callback]) ⇒ Promise

Returns an array with all deployments.

Kind: instance method of Now
See: https://zeit.co/api#list-endpoint

Param Type Description
[callback] function Callback will be called with (err, deployments)

now.getDeployment(id, [callback]) ⇒ Promise

Returns an object with deployment data.

Kind: instance method of Now
See: https://zeit.co/api#get-endpoint

Param Type Description
id String ID of deployment
[callback] function Callback will be called with (err, deployment)

now.createDeployment(body, [callback]) ⇒ Promise

Creates a new deployment and returns its data.

Kind: instance method of Now
See: https://zeit.co/api#instant-endpoint

Param Type Description
body Object The keys should represent a file path, with their respective values containing the file contents.
[callback] function Callback will be called with (err, deployment)

now.deleteDeployment(id, [callback]) ⇒ Promise

Deletes a deployment and returns its data.

Kind: instance method of Now
See: https://zeit.co/api#rm-endpoint

Param Type Description
id String ID of deployment
[callback] function Callback will be called with (err, deployment)

now.getFiles(id, [callback]) ⇒ Promise

Returns an array with the file structure.

Kind: instance method of Now
See: https://zeit.co/api#file-structure-endpoint

Param Type Description
id String ID of deployment
[callback] function Callback will be called with (err, fileStructure)

now.getFile(id, fileId, [callback]) ⇒ Promise

Returns the content of a file either as string or object, depending on the filetype.

Kind: instance method of Now
See: https://zeit.co/api#file--endpoint

Param Type Description
id String ID of deployment
fileId String ID of the file
[callback] function Callback will be called with (err, fileContent)

now.getDomains([callback])] ⇒ Promise

Returns an array with all domain names and related aliases.

Kind: instance method of Now See: https://zeit.co/api#get-domains

Param Type Description
[callback] function Callback will be called with (err, domains)

now.addDomain(domain, [callback])] ⇒ Promise

Adds a new domain and returns its data.

Kind: instance method of Now See: https://zeit.co/api#post.domains

Param Type Description
domain object An object containing a string name and a boolean isExternalDNS
[callback] function Callback will be called with (err)

now.deleteDomain(name, [callback])] ⇒ Promise

Deletes a domain name.

Kind: instance method of Now See: https://zeit.co/api#delete-domains

Param Type Description
name String Domain name
[callback] function Callback will be called with (err)

now.getDomainRecords(domain, [callback])] ⇒ Promise

Returns an array with all DNS records configured for a domain name.

Kind: instance method of Now See: https://zeit.co/api#get-domain-records

Param Type Description
name String Domain name
[callback] function Callback will be called with (err, domains)

now.addDomainRecord(domain, recordData, [callback])] ⇒ Promise

Adds a new DNS record for a domain.

Kind: instance method of Now See: https://zeit.co/api#post-domain-records

Param Type Description
domain String Domain name
recordData object An object containing a description of the new record according to the documentation.
[callback] function Callback will be called with (err)

now.deleteDomainRecord(name, recordId, [callback])] ⇒ Promise

Deletes a DNS record associated with a domain.

Kind: instance method of Now See: https://zeit.co/api#delete-domain-records

Param Type Description
domain String Domain name
recordId String Record ID
[callback] function Callback will be called with (err)

now.getCertificates([cn], [callback])] ⇒ Promise

Returns an array of all certificates.

Kind: instance method of Now See: https://zeit.co/api#get-certs

Param Type Description
[cn] String Common Name
[callback] function Callback will be called with (err, certs)

now.createCertificate(cn, [callback])] ⇒ Promise

Creates a new certificate for a domain registered to the user.

Kind: instance method of Now See: https://zeit.co/api#post-certs

Param Type Description
cn String Common Name
[callback] function Callback will be called with (err)

now.renewCertificate(cn, [callback])] ⇒ Promise

Renews an existing certificate.

Kind: instance method of Now See: https://zeit.co/api#post-certs

Param Type Description
cn String Common Name
[callback] function Callback will be called with (err)

now.replaceCertificate(cn, cert, key, [ca], [callback])] ⇒ Promise

Replace an existing certificate.

Kind: instance method of Now See: https://zeit.co/api#put-certs

Param Type Description
cn String Common Name
cert String X.509 certificate
key String Private key for the certificate
ca String CA certificate chain
[callback] function Callback will be called with (err, created)

now.deleteCertificate(cn, [callback])] ⇒ Promise

Deletes a certificate.

Kind: instance method of Now See: https://zeit.co/api#delete-certs

Param Type Description
cn String Common Name
[callback] function Callback will be called with (err)

now.getAliases([id OR callback], [callback]) ⇒ Promise

Returns an array with all aliases.

Kind: instance method of Now
See: https://zeit.co/api#user-aliases

Param Type Description
[id OR callback] String | function ID of deployment or callback
[callback] function Callback will be called with (err, aliases)

now.createAlias(id, alias, [callback]) ⇒ Promise

Creates an alias for the given deployment.

Kind: instance method of Now
See: https://zeit.co/api#create-alias

Param Type Description
id String ID of deployment
alias String Hostname or custom url for the alias
[callback] function Callback will be called with (err, data)

now.deleteAlias(id, [callback]) ⇒ Promise

Deletes an alias and returns a status.

Kind: instance method of Now
See: https://zeit.co/api#delete-user-aliases

Param Type Description
id String ID of alias
[callback] function Callback will be called with (err, status)

now.getSecrets([id OR callback], [callback]) ⇒ Promise

Returns an array with all secrets.

Kind: instance method of Now
See: https://zeit.co/api#get-now-secrets

Param Type Description
[id OR callback] String | function ID of deployment or callback
[callback] function Callback will be called with (err, secrets)

now.createSecret(name, value, [callback]) ⇒ Promise

Creates a secret and returns its ID.

Kind: instance method of Now
See: https://zeit.co/api#post-now-secrets

Param Type Description
name String name for the secret
value String value for the secret
[callback] function Callback will be called with (err, data)

now.renameSecret(id, name, [callback]) ⇒ Promise

Changes the name of the given secret and returns its ID and name.

Kind: instance method of Now
See: https://zeit.co/api#patch-now-secrets

Param Type Description
id String id or name of the secret
name String new name for the secret
[callback] function Callback will be called with (err, data)

now.deleteSecret(id, [callback]) ⇒ Promise

Deletes a secret and returns its ID.

Kind: instance method of Now
See: https://zeit.co/api#delete-now-secrets

Param Type Description
id String ID or name of the secret
[callback] function Callback will be called with (err, status)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].