https://github.com/zephyrpersonal/fetchman
A wrapped fetch api with custom config
https://github.com/zephyrpersonal/fetchman
Last synced: 9 months ago
JSON representation
A wrapped fetch api with custom config
- Host: GitHub
- URL: https://github.com/zephyrpersonal/fetchman
- Owner: zephyrpersonal
- Created: 2016-08-18T09:46:36.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-11-20T17:10:06.000Z (over 9 years ago)
- Last Synced: 2025-03-12T13:14:28.920Z (over 1 year ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Fetchman
Simple fetch api for client and node
## install
```bash
npm install fetchman -S
```
## usage
```javascript
var fetchman = require('fetchman')
/**
* Fetcher
* @param {String} url remote api url
* @param {Object} opts fetch options
* @return {Function}
*/
var remoteFoo = fetchman('/foo',{token:'bar'})
remoteFoo.get() // also post,put,delete,patch
remoteFoo(1).get() // will fetch resource "/foo/1"
```