Socket
Book a DemoInstallSign in
Socket

co-debug

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

co-debug

Better debug information for co

0.0.1
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

co-debug

node NPM version Dependency Status Travis CI codecov

Better debug information for co.

co-debug turns

TypeError: You may only yield a function, promise, generator, array, or object, but the following object was passed: "undefined"
    at next (co-debug/node_modules/co/index.js:101:25)
    ...

into

TypeError: You may only yield a function, promise, generator, array, or object, but the following object was passed: "undefined"
  co-debug/test/test.js function: foo
  0: yield bar()
  1: yield Promise.resolve()
    at next (co-debug/node_modules/co/index.js:101:25)
    ...

Install

npm i co-debug

You may need to install co by yourself.

Usage

node -r co-debug

Or add require('co-debug') to your main file and make sure it's loaded before other packages:

require('co-debug')
const Koa = require('koa')
const app = new Koa()
app.use(function * () {})

Notes

co-debug has some limitations

co-debug only can tell:

  • The function name that throws error
  • The list of yield within the function
  • The file path that contains the function

Examples:

co-debug/test/test.js function: foo
0: yield bar()
1: yield Promise.resolve()

co-debug may have trouble working with transpilers.

Only use co-debug when needed

if (process.env.NODE_ENV !== 'production') {
  require('co-debug')
}
const co = require('co')
// other stuffs

FAQs

Package last updated on 09 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.