The simplest option of such material:
var mat = new THREE.MeshBasicMaterial({side: THREE.DoubleSide});
mat.onBeforeCompile = shader => {
shader.fragmentShader = shader.fragmentShader.replace(
`#include <fog_fragment>`,
`#include <fog_fragment>
gl_FragColor.rgb = gl_FrontFacing ? vec3(0,1,0) : vec3(1, 0, 0);
`
);
}