question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there a way to remove the require hook?

See original GitHub issue

From the README:

require('async-to-gen/register')
require('./some-module-with-async-functions')

What if only need the hook for one file? Is there a way to remove the hook after it’s done being useful? Something like:

var undo = require('async-to-gen/register')
require('./some-module-with-async-functions') // works
undo()
require('./another-module-with-async-functions') // breaks

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
leebyroncommented, Nov 20, 2016

Yep! I think that’s a good idea. The default includes should be “all” and the default excludes should be “node_modules/” - then the check could be if (isIncluded && !isExcluded)

0reactions
hzoocommented, Nov 21, 2016

Yep Babel has excludes with node_modules excluded as the default

Read more comments on GitHub >

github_iconTop Results From Across the Web

EASIEST HOOK REMOVAL TRICK...I HOOKED MYSELF TO ...
Have you ever been hooked when fishing and need to know How to remove a fish hook from your skin? If it is...
Read more >
[feature request] Removing hooks from module #5037 - GitHub
But it appears that there is no way to remove a hook. Looking in the code, I believe it is just a matter...
Read more >
Hooked! One Simple Way to Remove an Embedded Hook in ...
The technique for removing an impaled hook is actually quite simple. Start by cutting off a two- to three-foot long section of heavy ......
Read more >
How to remove remote git hooks? - Stack Overflow
So basically removing remote git hooks is not possible. The best you can do is to remove your local ones ...
Read more >
How to remove WordPress Hooks that use Closures ... - Inpsyde
For this reason, to be sure to succeed in removing, the best thing to do is to pass to remove_action / remove_filter the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found