Provide require() in console
See original GitHub issueWe should figure out a way to provide a global require()
in DEV mode in the browser console.
It could be implemented as a webpack plugin (everything is a plugin in webpack right?)
It could work like this:
- For modules with unique names,
require('moduleName')
just works - For modules with non-unique names,
require('./full/path/from/root')
is the only way
Still not too bad!
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:5 (5 by maintainers)
Top Results From Across the Web
How do I require() from the console using webpack?
First, require the module at least once. import "webpack-runtime-require";. It will then add a Require() function to the window object ...
Read more >Requiring modules in Node.js: Everything you need to know
You can think of the require module as the command and the module module as the organizer of all required modules. Requiring a...
Read more >Console | Node.js v19.3.0 Documentation
A global console instance configured to write to process.stdout and process.stderr . The global console can be used without calling require('node:console') .
Read more >Getting User Input in Node.js - Codecademy
The prompt-sync Node module provides an easy-to-use alternative to this callback-based syntax. ... const prompt = require('prompt-sync')();. Notice the extra () ...
Read more >Node.js new Console() Method - GeeksforGeeks
The console module provides a simple debugging console that is provided by web ... we need to create a console using (new Console())...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can try it out on facebook.com fyi, it’s super useful for debugging
This is freaking handy indeed!