{"id":17789929,"url":"https://github.com/samrocksc/howard","last_synced_at":"2025-09-23T17:31:36.009Z","repository":{"id":57266984,"uuid":"101774921","full_name":"samrocksc/howard","owner":"samrocksc","description":"An isomorphic-fetch based library for making api calls super easy.","archived":false,"fork":false,"pushed_at":"2019-01-22T17:24:31.000Z","size":622,"stargazers_count":6,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T18:56:29.400Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samrocksc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"code_of_conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-29T15:09:58.000Z","updated_at":"2019-01-22T17:24:33.000Z","dependencies_parsed_at":"2022-08-31T22:32:24.345Z","dependency_job_id":null,"html_url":"https://github.com/samrocksc/howard","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samrocksc%2Fhoward","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samrocksc%2Fhoward/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samrocksc%2Fhoward/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samrocksc%2Fhoward/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samrocksc","download_url":"https://codeload.github.com/samrocksc/howard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233989073,"owners_count":18762034,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-27T10:39:30.318Z","updated_at":"2025-09-23T17:31:30.462Z","avatar_url":"https://github.com/samrocksc.png","language":"JavaScript","funding_links":[],"categories":["Homegrown Open-Source Software"],"sub_categories":[],"readme":"# Howard The Duck\n\n[![NPM](https://nodei.co/npm/howard.png?compact=true)](https://nodei.co/npm/howard/)\n\n[![Build Status](https://travis-ci.org/samrocksc/howard.svg?branch=master)](https://travis-ci.org/samrocksc/howard)\n\n[![CircleCI](https://circleci.com/gh/samrocksc/howard.svg?style=svg)](https://circleci.com/gh/samrocksc/howard)\n\n[![Coverage Status](https://coveralls.io/repos/github/samrocksc/howard/badge.svg?branch=master)](https://coveralls.io/github/samrocksc/howard?branch=master)\n\n![howard](howard.png)\n\nI simplify life!  If you are on a project that requires a lot of api Calls I can just handle the data retrieval in a quick and efficient manner!  Set a simple config file of the base URL and start making easier REST calls!\n\nHoward is basically a factory function for an [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch) call that extracts JSON and returns it as a promise.  Do whatever you want with the Promise, tag it in a chain.....tap it and use the results?  Make what you need to happen with it!\n\n## Examples!!!!\n\nIncluding Howard:\n\n```javascript\nimport howard, { withDefaults, json, text, arrayBuffer, blob, formData, buffer} from 'howard';\n```\n\n```javascript\njson(howard('https://swapi.co/api/people/1/'))\n  .then((res) =\u003e {\n    /*\n      {\n        \"name\": \"Luke Skywalker\",\n        ...\n      }\n    */\n  })\n```\n\nNeed Query Strings? put them in manually, or pass a param object!\n\n```javascript\nconst paramString = '?format=wookiee';\njson(howard(`https://swapi.co/api/people/1${paramString}`, { method: 'GET' }))\n  .then((res) =\u003e {\n    /*\n      {\n        \"whrascwo\": \"Lhuorwo Sorroohraanorworc\",\n        \"acwoahrracao\": \"172\",\n        \"scracc\": \"77\",\n        ...\n      }\n    */\n  })\n```\n\nUsing a param:\n\n```javascript\n  json(howard('https://swapi.co/api/people/1', { method: 'GET', params: { format: 'wookiee' } }))\n    .then((res) =\u003e {\n      return res;\n  })\n```\n\nIf you need to set up a client with a default configuration, use the `withDefaults` method and specify a config object that gets merged with options for every request. In this example we also use async await:\n\n```Javascript\nconst api = withDefaults(config);\n\njson(api('/people/1/'))\n  .then((res) =\u003e{\n    console.log('res', res)\n  })\n\nasync function withDefaultsRequest() {\n  let response = await json(api('/people/1/', { method: 'GET'}));\n  return response;\n    /*\n      {\n        \"name\": \"Luke Skywalker\",\n        ...\n      }\n    */\n}\n\nwithDefaultsRequest();\n```\n\n**A Highly Opinionated Setup** - The goal of this setup would to create a lib style setup and return the fetch with the assumption that most of the app is going to be delivering JSON.  This would apply to almost all use cases.\n\n```Javascript\nimport { withDefaults, json } from 'howard';\n\nconst api = withDefaults({\n  url: 'http://api.url.com',\n});\n\nexport function apiFetch(path, options = {}) {\n  return json(api(path, options));\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamrocksc%2Fhoward","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamrocksc%2Fhoward","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamrocksc%2Fhoward/lists"}