kaitai-struct-loader
v0.9.0
Published
This [webpack loader](https://webpack.js.org/concepts/loaders/) adds support for [Kaitai Struct](https://kaitai.io) .ksy definitions.
Downloads
197
Readme
Kaitai Struct loader for webpack
This webpack loader adds support for Kaitai Struct .ksy definitions.
Installation
yarn add --dev kaitai-struct-loader
Usage
file.js
import KaitaiStream from 'kaitai-struct/KaitaiStream';
import DoomWAD from './game/doom_wad.ksy';
const stream = new KaitaiStream(arrayBuffer);
const data = new DoomWAD(stream);
The specification of the Doom .wad format can be found in the format gallery.
webpack.config.js
module.exports = {
module: {
rules: [
{
test: /\.ksy$/,
use: [{
loader: 'kaitai-struct-loader',
// options: { debug: true },
}],
},
]
}
}
Options
| Name | Type | Default | Description |
| - | - | - | - |
| debug
| {boolean}
| false
| Compile .ksy files in --debug
mode (see #332 for more info) |