A simple, modern, and async-ready wrapper for the Heroku API V3 written in JavaScript.
git clone https://github.com/ezrael-git/heroku3.js.git
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];
List all apps in name order:
let apps = heroku_conn.apps("name");
Restart an app's Dyno:
await app.dynos()[0].restart();
Get account:
let account = heroku_conn.account;
Change password:
await account.change_password('CURRENT_PASSWORD', 'NEW_PASSWORD');
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();
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();