Socket
Socket
Sign inDemoInstall

nodejitsu-api

Package Overview
Dependencies
3
Maintainers
2
Versions
47
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodejitsu-api


Version published
Maintainers
2
Install size
1.10 MB
Created

Readme

Source

nodejitsu-api/node.js

The Node.JS Nodejitsu-api library enables accessing Nodejitsu's RESTful API.

Example:

var nj = require('nodejitsu-api'),
    fs = require('fs');

var client = nj.createClient({
  username: 'marak',
  password: 'foobar',
  remoteUri: 'http://api.nodejitsu.com'
});

client.apps.list(function(err, result){
  if (err) {
    console.log(err);
    return;
  }
  console.log(JSON.stringify(result, null, 2, true));
});

Install:

This library may be installed using npm:

npm install nodejitsu-api

Usage:

api.createClient(options)

This method sets up a client for connecting to Nodejitsu's databases. Here's a minimal example for connecting to Nodejitsu's API as Marak:

var client = nj.createClient({
  username: 'marak',
  password: 'foobar',
  remoteUri: 'http://api.nodejitsu.com'
});

The options object contains three required properties:

client

Method calls are generally structured as resource and action.

client.resource.action("data", function (err, result) {
  if (err) {
    throw err;
  }

  // use the result

});

Most actions take a string argument and a callback, though a few actions only take a callback.

The client's methods are reflective of jitsu's resources. Here's a broad overview:

  • client.apps: Manage your application instances. Methods include:
    • apps.available
    • apps.list
    • apps.start
    • apps.stop
  • client.databases: Manage your databases. Methods include:
    • databases.create
    • databases.destroy
    • databases.list
  • client.snapshots: Manage application snapshots. Methods include:
    • snapshots.activate
    • snapshots.create
    • snapshots.destroy
    • snapshots.list
  • client.logs: Manage logs from your applications. Methods include:
    • logs.byApp
    • logs.byUser
  • client.users: Manage your nodejitsu acccounts. Methods include:
    • users.available
    • users.create
    • users.confirm
    • users.forgot

License

MIT.

FAQs

Last updated on 04 Nov 2011

Did you know?

Socket

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc