Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kaitai-io/kaitai_struct_loader

Webpack loader for kaitai-struct .ksy definitions
https://github.com/kaitai-io/kaitai_struct_loader

binary kaitai-struct webpack-loader webpack2

Last synced: about 1 month ago
JSON representation

Webpack loader for kaitai-struct .ksy definitions

Awesome Lists containing this project

README

        

# Kaitai Struct loader for webpack

[![npm](https://img.shields.io/npm/v/kaitai-struct-loader)](https://www.npmjs.com/package/kaitai-struct-loader)

This [webpack loader](https://webpack.js.org/concepts/loaders/) adds support for [Kaitai Struct](https://kaitai.io) .ksy definitions.

## Installation

```sh
yarn add --dev kaitai-struct-loader
```

## Usage

file.js

```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](https://formats.kaitai.io/doom_wad/).*

webpack.config.js

```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](https://github.com/kaitai-io/kaitai_struct/issues/332) for more info) |