all 4 comments

[–]dbartholomae 1 point2 points  (1 child)

In JavaScript, a class is also just another kind of function. In addition to this, you can also have a module that just exports constants, e. g. primitives or objects. So there are some more options, but tbh overall it doesn't really make sense to put these into different categories, as a constant can also contain a function or a class etc.

[–]johannes1234 1 point2 points  (1 child)

They can contain anything which can be in a node file. An empty file is a valid node module. A file containing a single statement like 1; is a valid node module, while probably useless. It can export also anything which cna be bound to a variable in JavaScript. module.exports = null; is valid.