{"id":13623527,"url":"https://github.com/woovibr/apiWithLog","last_synced_at":"2025-04-15T14:33:22.654Z","repository":{"id":154194348,"uuid":"626392887","full_name":"woovibr/apiWithLog","owner":"woovibr","description":"Powerful Fetch","archived":false,"fork":false,"pushed_at":"2025-04-08T12:14:02.000Z","size":185,"stargazers_count":24,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-08T13:25:20.918Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/woovibr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-11T11:32:50.000Z","updated_at":"2025-04-08T12:14:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"3e6afe12-f077-494c-9b60-a6331ae654ae","html_url":"https://github.com/woovibr/apiWithLog","commit_stats":null,"previous_names":["woovibr/apiwithlog","entria/apiwithlog"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woovibr%2FapiWithLog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woovibr%2FapiWithLog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woovibr%2FapiWithLog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/woovibr%2FapiWithLog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/woovibr","download_url":"https://codeload.github.com/woovibr/apiWithLog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248774968,"owners_count":21159534,"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-08-01T21:01:32.794Z","updated_at":"2025-04-15T14:33:22.396Z","avatar_url":"https://github.com/woovibr.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# @woovi/apiWithLog\n\nPowerful `fetch` wrapper with the given functionallies:\n\n- log request and response when using env `DEBUG=true`\n- save request when using env `WRITE_MOCK=true`\n- reply request when using env `USE_MOCK=true`\n- send error to slack and sentry based on your setup\n\n## Usage\n\nThis will make the request but it won't show any logs\n\n```bash\nyarn es scripts/test.ts \n```\n\nShow request and response logs\n\n```bash\nDEBUG=true yarn es scripts/test.ts \n```\n\nOutput example\n\n````shell\nGET https://cat-fact.herokuapp.com/facts\n{\n  time: 'NaNms',\n  init: 'https://cat-fact.herokuapp.com/facts',\n  options: { headers: { 'user-agent': 'node-fetch' } },\n  json: [\n    {\n      status: { verified: true, feedback: '', sentCount: 1 },\n      _id: '5887e1d85c873e0011036889',\n      user: '5a9ac18c7478810ea6c06381',\n      text: 'Cats make about 100 different sounds. Dogs make only about 10.',\n      __v: 0,\n      source: 'user',\n      updatedAt: '2020-09-03T16:39:39.578Z',\n      type: 'cat',\n      createdAt: '2018-01-15T21:20:00.003Z',\n      deleted: false,\n      used: true\n    },    \n  ],\n  ok: true,\n  status: 200,\n  curl: `curl 'https://cat-fact.herokuapp.com/facts' -H \"user-agent: node-fetch\"`\n}\n````\n\nSave request to mock\n\n```bash\nWRITE_MOCK=true DEBUG=true yarn es scripts/test.ts \n```\n\nGo check `mock-requests.json`\n\nReply requests from mock\n\n```bash\nUSE_MOCK=true DEBUG=true yarn es scripts/test.ts\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoovibr%2FapiWithLog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwoovibr%2FapiWithLog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoovibr%2FapiWithLog/lists"}