I was working on a node Js and encountered an error when requiring a filesystem module in a ".js" file but then I searched for a while and saw somewhere that renaming the file to ".cjs" solves the error and it did!
Can someone explain to me why that was. I have no CS background