Socket
Socket
Sign inDemoInstall

heroku.js

Package Overview
Dependencies
96
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

heroku.js

Node.js library for interaction with the Heroku API.


Version published
Maintainers
1
Weekly downloads
1
decreased by-66.67%

Weekly downloads

Readme

Source

Heroku.js

The Node.js implementation of the Heroku API. Initially a port of Heroku.rb, Heroku.jar and Heroku.py, but with some Javascript-isms and some aliases added for convention and convenience.

Installation

1 Install via npm

npm install heroku.js

Usage

Begin by instantiating with credentials. You can use an application API Key, a user email address and API Token, or a username and password. The latter will fetch an API Key first, so it is an asynchronous request. It will require a callback. If you pass nothing, it will attempt to read process.env['HEROKU_API_KEY']

// Instantiate with the API Key in the environment
var api = new HerokuAPI();

// Instantiate with API Key
var api = new HerokuAPI({"apiKey" : apiKey});

// Instantiate with email and API Token
var api = new HerokuAPI({"email" : email, "apiToken" : apiToken});

// Instantiate with username and password **Async reminder**
new HerokuAPI({ "username" : username, "password" : password }, function(api) {
  // Use the `api` here
});
Create an application on the cedar stack
var api = new HerokuAPI(apiKey);
var app = api.postApp({
  "stack" : "Cedar",
  "name" : "MyApp"
});
List applications
var api = new HerokuAPI(apiKey);
var apps = api.getApps();
for (var i=0; l=apps.length; i < l; i++) {
  console.log(app.name);
}
Add Config
var api = new HerokuAPI(apiKey);
api.putConfigVars("myExistingApp", { "SOME_KEY" : "SOMEVALUE" });
Get Config
var api = new HerokuAPI(apiKey);
var config = api.getConfigVars("myExistingApp");
console.log(config);
Remove Config
var api = new HerokuAPI(apiKey);
api.deleteConfigVar("myExistingApp", "SOME_KEY");

Building Locally

1 Clone the repository

git clone https://github.com/dncrews/heroku.js.git

2 Run the testing suite (eventual - This is currently non-functional).

npm test
  • Todo
    • Different Error Handling
      • Unauthorized
      • Verification Required
      • Forbidden
      • Not Found
      • Timeout
      • Locked
      • Rate Limit Exceeded
      • Request Failed
      • Nil App
    • Mock API
      • This one is HUGE. It's to make my tests actually work

Keywords

FAQs

Last updated on 12 Sep 2013

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc