Skip to content

ezrael-git/heroku3.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

heroku3.js

A simple, modern, and async-ready wrapper for the Heroku API V3 written in JavaScript.

Installation

git clone https://github.com/ezrael-git/heroku3.js.git

Introduction

First instantiate a heroku_conn as below:

heroku_conn = require("./heroku3.js");
heroku = heroku_conn.build('YOUR_API_KEY');

Interact with your applications:

>>> heroku_conn.apps();
[ {name: "sharp-night-770", ...}, {name: "handsome-hand-190", ...}, ...]

>>> let app = heroku_conn.get_app("sharp-night-770");
//or
>>> let app = heroku_conn.apps[0];

Examples

List all apps in name order:

let apps = heroku_conn.apps("name");

Restart an app's Dyno:

await app.dynos()[0].restart();

Account

Get account:

let account = heroku_conn.account;

Change password:

await account.change_password('CURRENT_PASSWORD', 'NEW_PASSWORD');

App

List all apps:

await heroku_conn.apps();

Get an app:

let app = await heroku_conn.get_app('stark-night-1770');

Delete an app:

// warning: this is irreversible
await app.delete();

Dyno

List all dynos:

await app.dynos();

Get a specific dyno from name:

let dyno = await app.get_dyno('worker.1');

Stop a dyno:

await dyno.stop();

Restart a dyno:

await dyno.restart();

About

A wrapper in JavaScript for the Heroku API V3.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published