# Using GLTFLoader on node

**URL:** <https://discourse.threejs.org/t/using-gltfloader-on-node/2309>\
**Category:** Questions\
**Tags:** node-js, gltf-loader\
**Created:** [April 2, 2018, 9:25pm UTC](https://discourse.threejs.org/t/using-gltfloader-on-node/2309 "2018-04-02T21:25:33Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![muhmundr](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@muhmundr](https://discourse.threejs.org/u/muhmundr)\
**Post date:** [July 8, 2020, 8:53am UTC](https://discourse.threejs.org/t/using-gltfloader-on-node/2309/7 "2020-07-08T08:53:52Z")

</div>

Yes, the topic is complex but seems that this is pretty popular topic. I found solution for work with GLB on node.js without textures. It works pretty well. I need only process of the 3d objects without rendering.  
I think that the only thing that should be solved is the Texture loading. I guess that if redefine the load textures function to the node.js function which will read data and convert it to base64 - it will work like a charm.

```
const toArrayBuffer = (buf) => {
  const arrayBuffer = new ArrayBuffer(buf.length);
  const view = new Uint8Array(arrayBuffer);
  for (let i = 0; i < buf.length; ++i) {
    view[i] = buf[i];
  }
  return arrayBuffer;
}

const loadGLTFModel = (fileName) => {
  const loader = new THREE.GLTFLoader();
  return new Promise((resolve, reject) => {
    if (fs.existsSync(fileName)) {
      const data = fs.readFileSync(fileName);
      const arrayBuffer = toArrayBuffer(data);
      loader.parse(arrayBuffer, '',
        (object3D) => {
          resolve(object3D);
        },
        (error) => {
          console.log(error);
          reject('Loader failed')
        });
    } else reject(`Cannot find ${fileName}`);
  });
}
```

---

_[View the full topic](https://discourse.threejs.org/t/using-gltfloader-on-node/2309)._
