Skip to content

aganglada/chicky

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chicky

🐥 chicky

window.fetch() api interface

  • Minimal basic interface for window.fetch().
  • Easy to use http methods.
  • Supported in old browsers IE8+ (using unfetch polyfill)
  • Written in ES6.

Install

You can install chicky from npm.

npm install chicky --save

or from yarn

yarn add chicky

Usage

import chicky from 'chicky';

chicky.get('http://api.github.com/aganglada')
   .then(data => {
      console.log(data); 
   });

Methods

get

Get data from anywhere at any time.

import chicky from 'chicky';

chicky.get('http://api.github.com/aganglada')
   .then(data => {
      console.log(data); 
   });

post

Create new data for a better future.

import chicky from 'chicky';

chicky.post('http://api.github.com/aganglada', {
    repo: {
        name: 'chicky'
    }
})
   .then(data => {
      console.log(data); 
   });

put

Update data to maintain the world.

import chicky from 'chicky';

chicky.put('http://api.github.com/aganglada', {
    repo: {
        name: 'chicky',
        owner: 'alex'
    }
})
   .then(data => {
      console.log(data); 
   });

patch

Change data of a single person and make it optimal.

import chicky from 'chicky';

chicky.patch('http://api.github.com/aganglada', {
    repo: {
        name: 'chicky',
        owner: 'alex'
    }
})
   .then(data => {
      console.log(data); 
   });

delete

Get rid of things you don't need.

import chicky from 'chicky';

chicky.delete('http://api.github.com/aganglada', {
    repo: {
        name: 'chicky'
    }
})
   .then(data => {
      console.log(data); 
   });

Contribute

If you like to contribute to this project be sure all the changes you made, make sense for everyone and they can continue using chicky as their general api service.

License

MIT © aganglada

About

🐥 window.fetch() api interface

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published