You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jBinary provides special Repo for popular file formats and corresponding demos.
Using standard typesets is easy - just make require-like call to jBinary.Repo async loader method.
You can call it with one typeset name:
jBinary.Repo('bmp',function(BMP){varbinary=newjBinary(data,BMP);// ...do whatever you want with `binary` or simply...vardata=binary.readAll();// ...get entire file as parsed object in `data`});
Or with list of names:
jBinary.Repo(['tar','gzip'],function(TAR,GZIP){// your code goes here ;)});
Or using AMD require method:
require(['jbinary.repo!tar','jbinary.repo!gzip'],function(TAR,GZIP){// you can put just the same code as in sample above});
All the typesets that are already loaded, are stored inside jBinary.Repo itself with upper-case names of typesets used as keys (like jBinary.Repo.BMP).
If you know some popular format structure and can write own typeset, you're welcome to contribute!