New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

coreapi

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coreapi

Javascript client library for Core API

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

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

Keywords

API

FAQs

Package last updated on 05 Oct 2017

Did you know?

Socket

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