How to get all faces of cube in newest version?

When I get all faces from BoxGeometry, it’s seem deprecated in the newest version.
I means, faces is undefined in this case:

const geometry = new THREE.BoxGeometry( 1, 1, 1 );
const mesh = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial() );
mesh.name = 'Box';
const faces = mesh.geometry.faces // undefined

How can get all faces of BoxGeometry in the 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