Socket
Socket
Sign inDemoInstall

nodejitsu-api

Package Overview
Dependencies
1
Maintainers
4
Versions
47
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nodejitsu-api

nodejitsu API client wrapper


Version published
Maintainers
4
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: 'https://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: 'https://api.nodejitsu.com'
});

The options object contains three required properties:

  • username: The username for your Nodejitsu account
  • password: The password for your Nodejitsu account
  • remoteUri: The uri of the api host (typically https://api.nodejitsu.com).

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
    • apps.destroy
  • 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
    • users.update

and many more...

Tests

All tests are written with vows and should be run with npm:

  $ npm test

License

MIT.

FAQs

Last updated on 07 Feb 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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc