{"id":13802041,"url":"https://github.com/chrisyip/co-debug","last_synced_at":"2025-07-02T13:07:52.563Z","repository":{"id":57201834,"uuid":"87658299","full_name":"chrisyip/co-debug","owner":"chrisyip","description":"Better debug information for co","archived":false,"fork":false,"pushed_at":"2017-04-09T09:50:47.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-22T13:48:06.133Z","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/chrisyip.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-08T19:18:58.000Z","updated_at":"2017-07-23T06:38:14.000Z","dependencies_parsed_at":"2022-09-17T11:21:24.245Z","dependency_job_id":null,"html_url":"https://github.com/chrisyip/co-debug","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chrisyip/co-debug","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyip%2Fco-debug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyip%2Fco-debug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyip%2Fco-debug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyip%2Fco-debug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrisyip","download_url":"https://codeload.github.com/chrisyip/co-debug/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisyip%2Fco-debug/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263145901,"owners_count":23420681,"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-04T00:01:34.017Z","updated_at":"2025-07-02T13:07:52.541Z","avatar_url":"https://github.com/chrisyip.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# co-debug\n\n[![node](https://img.shields.io/node/v/co-debug.svg)](https://github.com/chrisyip/co-debug) [![NPM version][npm-image]][npm-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Travis CI][travis-image]][travis-url] [![codecov][codecov-image]][codecov-url]\n\nBetter debug information for co.\n\n`co-debug` turns\n\n```\nTypeError: You may only yield a function, promise, generator, array, or object, but the following object was passed: \"undefined\"\n    at next (co-debug/node_modules/co/index.js:101:25)\n    ...\n```\n\ninto\n\n```\nTypeError: You may only yield a function, promise, generator, array, or object, but the following object was passed: \"undefined\"\n  co-debug/test/test.js function: foo\n  0: yield bar()\n  1: yield Promise.resolve()\n    at next (co-debug/node_modules/co/index.js:101:25)\n    ...\n```\n\n## Install\n\n```\nnpm i co-debug\n```\n\nYou may need to install `co` by yourself.\n\n## Usage\n\n```\nnode -r co-debug\n```\n\nOr add `require('co-debug')` to your main file and make sure it's loaded before other packages:\n\n```js\nrequire('co-debug')\nconst Koa = require('koa')\nconst app = new Koa()\napp.use(function * () {})\n```\n\n## Notes\n\n### `co-debug` has some limitations\n\n`co-debug` only can tell:\n\n- The function name that throws error\n- The list of `yield` within the function\n- The file path that contains the function\n\nExamples:\n\n```\nco-debug/test/test.js function: foo\n0: yield bar()\n1: yield Promise.resolve()\n```\n\n`co-debug` may have trouble working with transpilers.\n\n### Only use `co-debug` when needed\n\n```js\nif (process.env.NODE_ENV !== 'production') {\n  require('co-debug')\n}\nconst co = require('co')\n// other stuffs\n```\n\n[npm-url]: https://npmjs.org/package/co-debug\n[npm-image]: http://img.shields.io/npm/v/co-debug.svg\n[daviddm-url]: https://david-dm.org/chrisyip/co-debug\n[daviddm-image]: http://img.shields.io/david/chrisyip/co-debug.svg\n[travis-url]: https://travis-ci.org/chrisyip/co-debug\n[travis-image]: http://img.shields.io/travis/chrisyip/co-debug.svg\n[codecov-url]: https://codecov.io/gh/chrisyip/co-debug\n[codecov-image]: https://img.shields.io/codecov/c/github/chrisyip/co-debug.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisyip%2Fco-debug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisyip%2Fco-debug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisyip%2Fco-debug/lists"}