rest-api-fetcher

0.1.2 • Public • Published

rest-api-fetcher

Usage example:

var rest_api_fetcher = require('rest-api-fetcher')

var codejquery = rest_api_fetcher.createRoute('http://code.jquery.com', ['jquery-3.3.1.js'])
codejquery.get()

var routes = [
    'posts',
    'comments'
]

var api = rest_api_fetcher.createRoutes('https://jsonplaceholder.typicode.com', routes)

// .get(id, subroute, query)

api.posts.get()
api.comments.get()

api.posts.get(1)
api.posts.get(1, 'comments')

api.comments.get(null, null, { postId: 1 })

Readme

Keywords

none

Package Sidebar

Install

npm i rest-api-fetcher

Weekly Downloads

1

Version

0.1.2

License

ISC

Unpacked Size

2.37 kB

Total Files

4

Last publish

Collaborators

  • yitzhakandrade