now-wrapper

0.0.2 • Public • Published



A programmatic API around now CLI

 

Build Status

 

work in progress, don't use this yet

setup

  1. install

    npm install now-wrapper --save-dev
  2. now API token

    now-wrapper looks for process.env.NOW_TOKEN You can generate a token from account/tokens

 

usage

Run your script in the directory you want to deploy

const { instance, alias } = require('now-wrapper')

const doStuff = async () => {
  /* we just made an app, let's deploy that baby */
  const deployment = await instance.deploy()
  if (!deployment.error) console.log(deployment.url)

  /* set alias */
  await alias.set(deployment.url, 'https://production-url.now.sh')

  /* instant regret, let's delete that thing */
  await instance.remove(deployment.url)
}

 

like it?

⭐ this repo

 

license

MIT © siddharthkp

Readme

Keywords

none

Package Sidebar

Install

npm i now-wrapper

Weekly Downloads

2

Version

0.0.2

License

MIT

Unpacked Size

4.53 kB

Total Files

7

Last publish

Collaborators

  • siddharthkp