import Debug from 'debug';
const debug = Debug('myapp');
I am trying to above syntax, app runs as expected but no debug output is shown
Please see the readme. You need to set an environment variable in Node.
This doesn't make sense @Qix- , the question is how to import using ES6 import syntax, not how to use the lib. In the readme they only teach how to import it using require.
BTW, I'm also looking for this answer
Setting environment variable fixed my problem, I was just little confused if the path I was following was right. Seems thats the correct syntax for importing and using debug with es6 import syntax
Sorry should have spelled it out a bit more. How OP is using it is fine. No output means they didn't set the environment variable (which is very, very well documented in the readme).
import Debug from "debug";
const debug = Debug("MyApp");
// then to use
debug("Something happened");
Most helpful comment
This doesn't make sense @Qix- , the question is how to import using ES6 import syntax, not how to use the lib. In the readme they only teach how to import it using require.
BTW, I'm also looking for this answer