jDataView/jBinary

Simple text file

Closed this issue · 4 comments

How can I load simple text file with unknown length?

Why do you need binary data library for text file? Why not just use AJAX / Node.js API for that?

Its webgl 3d engine and i have wrote one general resource loader for textures, meshes, shaders and etc. Shader are text file.

The best would be still to load them with regular AJAX.

However, if you still want to use jBinary's loader and parser, you can do something like:

jBinary.load(source).then(function (binary) {
  var text = binary.read('string' /* , 'utf-8' */);
  // do whatever you want with retrieved text
});

Thanks.