trepo-client

0.4.1 • Public • Published

trepo-client-js

A Client that abstracts the routing between various Trepo Servers.

Example

import Client from './some/where/Client.js';
 
let worker; // A web worker for https://repo1.example.com
let trepo; // A local trepo for https://repo2.example.com
 
let client = new Client();
 
client.addWorkerRoute('https://repo1.example.com', worker);
client.addLocalRoute('https://repo2.example.com', trepo);
 
 
client.request({
    repo: 'https://repo1.example.com'
  })
  .then(response => {
    // Do something here.
  })
  .catch(error => {
    // Something bad happened.
    // error Looks like {code: 4xx, msg: 'whoopsie'}
  })
 

Readme

Keywords

Package Sidebar

Install

npm i trepo-client

Weekly Downloads

2

Version

0.4.1

License

MIT

Last publish

Collaborators

  • jonnymbgood
  • justincy