0.1.1 • Published 7 years ago

coreapi v0.1.1

Weekly downloads
276
License
BSD-2-Clause
Repository
github
Last release
7 years ago

Javascript client library

Javascript client library for Core API.

travis-image npm-image codecov-image

In progress.

Usage

Browser

The core js library is available on the unpkg cdn. Once loaded the library will be available on window.coreapi.

<script src="https://unpkg.com/coreapi@latest/dist/coreapi.js"></script>

<script type="text/javascript">
    var coreapi = window.coreapi;
    var client = new coreapi.Client();

    client.get("http://httpbin.org/")
      .then(function (data) {
        var responseElement = document.getElementById("response");
        responseElement.innerText = data;
      })
      .catch(function (error) {
        console.log("ERROR: ", error);
      });
</script>
Node

Install it with NPM or add it to your package.json:

$ npm install coreapi
const coreapi = require('coreapi');

const client = new coreapi.Client()

client.get("http://httpbin.org/")
  .then((data) => {
    console.log("Status: ", data);
  })
  .catch((error) => {
    console.log("Error: ", error);
  });

Tests

To run the tests (linting & unit tests):

npm test
0.1.1

7 years ago

0.1.0

7 years ago

0.0.20

7 years ago

0.0.19

7 years ago

0.0.18

7 years ago

0.0.17

7 years ago

0.0.16

7 years ago

0.0.15

7 years ago

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 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

0.0.0

9 years ago