How to get all faces of cube in newest version?

The new versions only use buffer geometry.
You have to work with the indices.

 const posArray = mesh.geometry.attributes.position.array;
 const indArray = mesh.geometry.index.array;

threejsResources/THREEn/THREEn.js at f7ecc1c0584c475225570dea6f5cd2f32dda96d3 · hofk/threejsResources · GitHub

See NumberingHelperExamples

from the Collection of examples from discourse.threejs.org


UPDATE
In this example you can see how to create a buffer geometry yourself. SkewedRectangularPyramid