fancy-emitter v1.3.6
Node version 14.2.0
I have an empty NodeJS project where I have installed fancy-emitter. This is my code:
import {Emitter} from 'fancy-emitter';
const action = new Emitter();
Running node index.mjs produces the following output:
import {Emitter} from 'fancy-emitter';
^^^^^^^
SyntaxError: The requested module 'fancy-emitter' does not provide an export named 'Emitter'
If I change the code to this:
import * as fancy from 'fancy-emitter';
const action = new fancy.Emitter();
I get the following output:
const action = new fancy.Emitter();
^
TypeError: fancy.Emitter is not a constructor
How does one use fancy-emitter? Thank you.
fancy-emitter v1.3.6
Node version 14.2.0
I have an empty NodeJS project where I have installed fancy-emitter. This is my code:
Running
node index.mjsproduces the following output:If I change the code to this:
I get the following output:
How does one use fancy-emitter? Thank you.