apsmee

0.6.0 • Public • Published

Apsmee

Currently in development.

Apsmee is a simple schema based api client over Superagent. It works with browserify and webpack.

Install

NPM

npm install apsmee

From source

git clone git@github.com:refast/apsmee.git apsmee
cd apsmee
npm install
npm run build

Usage example

Simple github client

const ApiClient = require('apsmee');
 
 
const githubSchema = {
  user: {
    getByName: { path: '/users/:name' },
  },
};
 
const githubClient = new ApiClient({
  host: 'https://api.github.com',
  schema: githubSchema,
});
 
const request = githubClient.user.getByName({ name: 'refast' });
request.then(response => {
  console.log(response.body);
});
request.catch(err => {
  console.log(err.status);
});

Readme

Keywords

none

Package Sidebar

Install

npm i apsmee

Weekly Downloads

0

Version

0.6.0

License

MIT

Last publish

Collaborators

  • refast