Skip to content

A client interface for the Phonegap Build API using nodejs.

License

Notifications You must be signed in to change notification settings

wxsolo/phonegapbuildapi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHONEGAP BUILD JS

A client interface for the Phonegap Build API using nodejs

Install

  npm install phonegapbuildapi

Or from source:

  git clone git://github.com/germallon/phonegapbuildapi.git 
  cd phonegapbuildapi
  npm link

##Description Phonegap Build API is a client interface for the Phonegap Build API (Duh!). Given that the API interacts using JSON-formatted strings, Javascript seems like the logical choice to process its input and output.

A commandline interface that partially implements the API has been provided.

   node interface.js

The interface allows you to interact with the API, but it is mainly provided to serve as an example on how to use the tool. You are encouraged to implement your own driver that fits your needs.

##Examples

###Simple Example Here's an example on how to display the user data on standard output:

   var api = require('phonegapbuildapi');

   api.createAuthToken("my@email.com:myp4ssw0rd", function(token){
      api.getUserData(token, function(userData){
         console.log(userData); //Output user data to stdout
         });         
      });

###Error Handling

Error handling is supported through callbacks. The above example can be expanded to handle any errors found.

   var api = require('phonegapbuildapi');

   api.createAuthToken("my@email.com:myp4ssw0rd", {

      success:function(token){
 
         api.getUserData(token, {
            success:function(userData){
               console.log(userData); //Output user data to stdout
               }, 
            error: function(errMsg){
               console.log("Error retrieving user data. Err: " + errMsg);
               }});         
         }, 
 
      error: function(errmsg){
         console.log("Error creating authentication token. Err: " + errmsg);
         }});

About

A client interface for the Phonegap Build API using nodejs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published