GithubHelp home page GithubHelp logo

pkdevbox / phonegapbuildapi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from enyojs/phonegapbuildapi

0.0 2.0 0.0 201 KB

A client interface for the Phonegap Build API using nodejs.

License: Apache License 2.0

JavaScript 100.00%

phonegapbuildapi's Introduction

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("[email protected]: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("[email protected]: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);
         }});

phonegapbuildapi's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.