@k67/kaitai-struct-ts 0.7.3 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -6
- package/dist/cli.js +1076 -887
- package/dist/index.d.mts +24 -1
- package/dist/index.d.ts +24 -1
- package/dist/index.js +183 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +183 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +19 -21
package/README.md
CHANGED
@@ -3,13 +3,14 @@
|
|
3
3
|
|
4
4
|
# kaitai-struct-ts
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
[](https://www.npmjs.com/package/@k67/kaitai-struct-ts)
|
7
|
+
[](https://github.com/fabianopinto/kaitai-struct-ts/actions)
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
9
|
+
[](https://www.typescriptlang.org/)
|
10
|
+
[](https://nodejs.org/)
|
11
|
+
|
12
|
+
**A runtime interpreter for [Kaitai Struct](https://kaitai.io/) binary format definitions in TypeScript.**
|
11
13
|
|
12
|
-
**A runtime interpreter for [Kaitai Struct](https://kaitai.io/) binary format definitions in TypeScript.**
|
13
14
|
</div>
|
14
15
|
|
15
16
|
---
|
@@ -19,6 +20,7 @@ Parse any binary data format by providing a `.ksy` (Kaitai Struct YAML) definiti
|
|
19
20
|
## Features
|
20
21
|
|
21
22
|
### Core Features
|
23
|
+
|
22
24
|
- 🚀 **Runtime interpretation** - No code generation needed
|
23
25
|
- 📦 **Zero dependencies** (runtime) - Only YAML parser for development
|
24
26
|
- 🎯 **TypeScript native** - Full type safety and IntelliSense support
|
@@ -27,6 +29,7 @@ Parse any binary data format by providing a `.ksy` (Kaitai Struct YAML) definiti
|
|
27
29
|
- 📖 **Well documented** - Clear API and examples
|
28
30
|
|
29
31
|
### Advanced Features
|
32
|
+
|
30
33
|
- ⚡ **Expression evaluation** - Full support for Kaitai expressions
|
31
34
|
- 🔀 **Switch/case types** - Dynamic type selection based on data
|
32
35
|
- 💎 **Instances** - Lazy-evaluated fields with caching
|
@@ -110,6 +113,7 @@ console.log(result.name)
|
|
110
113
|
**Completion:** ~95% toward v1.0.0
|
111
114
|
|
112
115
|
### ✅ Fully Implemented
|
116
|
+
|
113
117
|
- **Core Runtime** - Complete binary stream reader with all primitive types
|
114
118
|
- **KSY Parser** - Full YAML parser with schema validation
|
115
119
|
- **Type Interpreter** - Execute schemas against binary data
|
@@ -120,6 +124,7 @@ console.log(result.name)
|
|
120
124
|
- **Documentation** - Complete user and developer documentation
|
121
125
|
|
122
126
|
### 🔄 Remaining for v1.0.0
|
127
|
+
|
123
128
|
- Substream processing (zlib, encryption)
|
124
129
|
- Type imports across files
|
125
130
|
- Additional performance optimizations
|
@@ -133,6 +138,7 @@ See [docs/development/PROGRESS.md](./docs/development/PROGRESS.md) for detailed
|
|
133
138
|
Parse binary data using a Kaitai Struct definition.
|
134
139
|
|
135
140
|
**Parameters:**
|
141
|
+
|
136
142
|
- `ksy` - YAML string containing the .ksy definition
|
137
143
|
- `buffer` - Binary data to parse
|
138
144
|
- `options` - Optional parsing options (validate, strict)
|
@@ -140,6 +146,7 @@ Parse binary data using a Kaitai Struct definition.
|
|
140
146
|
**Returns:** Parsed object with fields defined in the .ksy file
|
141
147
|
|
142
148
|
**Example:**
|
149
|
+
|
143
150
|
```typescript
|
144
151
|
import { parse } from 'kaitai-struct-ts'
|
145
152
|
|
@@ -176,6 +183,7 @@ kaitai format.ksy data.bin --quiet # Quiet mode
|
|
176
183
|
**📖 Full CLI Documentation:** [docs/CLI.md](./docs/CLI.md)
|
177
184
|
|
178
185
|
**Quick Reference:**
|
186
|
+
|
179
187
|
- `-o, --output <file>` - Write to file
|
180
188
|
- `--field <path>` - Extract specific field
|
181
189
|
- `-q, --quiet` - Suppress progress messages
|
@@ -219,6 +227,7 @@ pnpm format
|
|
219
227
|
## Roadmap
|
220
228
|
|
221
229
|
### ✅ Phase 1: Foundation (v0.1.0) - Complete
|
230
|
+
|
222
231
|
- ✅ Binary stream reader (KaitaiStream)
|
223
232
|
- ✅ All primitive types (u1-u8, s1-s8, f4, f8)
|
224
233
|
- ✅ String encoding (UTF-8, ASCII, Latin-1, UTF-16)
|
@@ -226,6 +235,7 @@ pnpm format
|
|
226
235
|
- ✅ Error handling system
|
227
236
|
|
228
237
|
### ✅ Phase 2: Core Features (v0.2.0-v0.4.0) - Complete
|
238
|
+
|
229
239
|
- ✅ KSY parser with validation
|
230
240
|
- ✅ Type interpreter
|
231
241
|
- ✅ Expression evaluator (full Kaitai expression language)
|
@@ -235,6 +245,7 @@ pnpm format
|
|
235
245
|
- ✅ Nested user-defined types
|
236
246
|
|
237
247
|
### ✅ Phase 3: Advanced Features (v0.5.0-v0.6.0) - Complete
|
248
|
+
|
238
249
|
- ✅ Switch/case type selection
|
239
250
|
- ✅ Instances (lazy-evaluated fields with caching)
|
240
251
|
- ✅ Parametric types
|
@@ -243,11 +254,13 @@ pnpm format
|
|
243
254
|
- ✅ Processing framework (ready for zlib/encryption)
|
244
255
|
|
245
256
|
### ✅ Phase 4: CLI & Polish (v0.7.0) - Complete
|
257
|
+
|
246
258
|
- ✅ Command-line interface
|
247
259
|
- ✅ Documentation reorganization
|
248
260
|
- ✅ Production-ready release
|
249
261
|
|
250
262
|
### 🔄 Phase 5: v1.0.0 - Final Polish (In Progress)
|
263
|
+
|
251
264
|
- ⏳ Processing implementations (zlib, encryption)
|
252
265
|
- ⏳ Type imports across files
|
253
266
|
- ⏳ Additional performance optimizations
|