Hey Tony, you are right we can use the Singleton constant directly and this is just a basic example to show the use case. And I always prefer to follow the common implementation way of these design patterns. We can use the same pattern inside class-based Singleton too. At last, we have two choices in javascript, either modularisation approach or singleton approach.
Tony B
Although there are a lot of good uses for Singletons, this example is a little ironic. The use of a Module means there is only one instance of the Singleton constant, so the entire class is unnecessary. In rare cases where complex dependencies and versions create multiple instances of a module, your example wouldn't work anyway as there would be multiple instances.
i.e. just use const Singleton = new Username() in your module and move on :)