ThreeJs has an abstraction that allows you to write your shaders using JavaScript, it is called ThreeJS Shading Language. This implementation makes of that to simplify development:
https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Lan...