-
Notifications
You must be signed in to change notification settings - Fork 0
JavaScript Library
denys.kramar edited this page Jul 9, 2025
·
2 revisions
Browser and Node.js compatible implementation with interactive web interface for GBL file manipulation.
npm install gbl-ninja// Parse existing GBL file
const gbl = new Gbl();
const parseResult = gbl.parseByteArray(gblFileBytes);
if (parseResult.type === 'Success') {
console.log(`Parsed ${parseResult.resultList.length} tags`);
// Process tags
} else {
console.error(`Parse error: ${parseResult.error}`);
}const builder = Gbl.GblBuilder.create()
.application(32, 0x10000, 0, 54)
.prog(0x1000, firmwareData);
const gblBytes = builder.buildToByteArray();const fileInput = document.getElementById('file-input');
fileInput.addEventListener('change', function(event) {
const file = event.target.files[0];
const reader = new FileReader();
reader.onload = function(e) {
const arrayBuffer = e.target.result;
const uint8Array = new Uint8Array(arrayBuffer);
const result = gbl.parseByteArray(uint8Array);
// Process result
};
reader.readAsArrayBuffer(file);
});- Browser and Node.js compatibility
- Interactive web interface
- File upload/download support
- Real-time parsing feedback
- No external dependencies