0.0.36 • Published 8 years ago

apiway.js v0.0.36

Weekly downloads
-
License
MIT
Repository
-
Last release
8 years ago

ApiWay.js

ApiWay.js provides a minimal higher-level wrapper around ApiWay's API.

Usage

/*
   Data can be retrieved from the API either using callbacks (as in versions < 1.0)
   or using a new promise-based API. The promise-based API returns the raw Axios
   request promise.
 */
import ApiWay from 'apiway-api';

// unauthenticated client
const aw = new ApiWay();
let user = gh.User(); // not a gist yet
user.updateProfile({
   }
}).then(function({data}) {
   // Promises!
   let createdGist = data;
   return gist.read();
}).then(function({data}) {
   let retrievedGist = data;
   // do interesting things
});
var ApiWay = require('apiway-api');

// basic auth
var gh = new ApiWay({
   username: 'FOO',
   password: 'NotFoo'
   /* also acceptable:
      token: 'MY_OAUTH_TOKEN'
    */
});

var me = gh.getUser(); // no user specified defaults to the user for whom credentials were provided
me.listNotifications(function(err, notifications) {
   // do some stuff
});

var clayreimann = gh.getUser('clayreimann');
clayreimann.listStarredRepos(function(err, repos) {
   // look at all the starred repos!
});

API Documentation

Installation

ApiWay.js is available from npm or unpkg.

npm install apiway-api
<!-- just apiway-api source (5.3kb) -->
<script src="https://unpkg.com/apiway-api/dist/ApiWay.min.js"></script>

<!-- standalone (20.3kb) -->
<script src="https://unpkg.com/apiway-api/dist/ApiWay.bundle.min.js"></script>

Compatibility

ApiWay.js is tested on Node.js:

  • 6.x

Note: ApiWay.js uses Promise, hence it will not work in Node.js < 4 without polyfill.

0.0.36

8 years ago

0.0.35

8 years ago

0.0.34

8 years ago

0.0.33

8 years ago

0.0.32

8 years ago

0.0.31

8 years ago

0.0.30

8 years ago

0.0.28

8 years ago

0.0.27

8 years ago

0.0.26

8 years ago

0.0.25

8 years ago

0.0.24

8 years ago

0.0.23

8 years ago

0.0.21

8 years ago

0.0.20

8 years ago

0.0.19

8 years ago

0.0.18

8 years ago

0.0.17

8 years ago

0.0.16

8 years ago

0.0.15

8 years ago

0.0.14

8 years ago

0.0.13

8 years ago

0.0.12

8 years ago

0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago