kaitai-struct-compiler 0.10.0 → 0.11.0-SNAPSHOT20231104.85023.e581718

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 CHANGED
@@ -54,6 +54,8 @@ Our [examples repository](https://github.com/kaitai-io/kaitai_struct_examples) c
54
54
 
55
55
  ## Plugging in
56
56
 
57
+ > **Note:** Before version 0.11.0, the `kaitai-struct-compiler` module returned a _compiler constructor_ (called `KaitaiStructCompiler`) and you would use it as `(new KaitaiStructCompiler()).compile(...)`, but since 0.11.0 it returns the _compiler object_ itself and you just need to do `KaitaiStructCompiler.compile(...)`. Make sure to adapt your code.
58
+
57
59
  We publish the compiler as a [UMD module](https://github.com/umdjs/umd), so it works from various environments, including server-side (e.g. Node.js) and client-side (e.g. web browser) ones.
58
60
 
59
61
  Note: currently we don't publish the compiler as standard ES module. This will probably change in the future. If you need ES module, please comment on [this issue](https://github.com/kaitai-io/kaitai_struct/issues/180).
@@ -61,8 +63,7 @@ Note: currently we don't publish the compiler as standard ES module. This will p
61
63
  ### node
62
64
 
63
65
  ```javascript
64
- var KaitaiStructCompiler = require("kaitai-struct-compiler");
65
- var compiler = new KaitaiStructCompiler();
66
+ var compiler = require("kaitai-struct-compiler");
66
67
  ```
67
68
 
68
69
  ### browser using script tags
@@ -70,7 +71,7 @@ var compiler = new KaitaiStructCompiler();
70
71
  ```html
71
72
  <script src="node_modules/kaitai-struct-compiler/kaitai-struct-compiler.js"></script>
72
73
  <script>
73
- var compiler = new KaitaiStructCompiler();
74
+ var compiler = KaitaiStructCompiler;
74
75
  </script>
75
76
  ```
76
77
 
@@ -85,8 +86,8 @@ var compiler = new KaitaiStructCompiler();
85
86
  }
86
87
  });
87
88
 
88
- require(['kaitai-struct-compiler'], function(KaitaiStructCompiler){
89
- var compiler = new KaitaiStructCompiler();
89
+ require(['kaitai-struct-compiler'], function(compiler){
90
+ // ...
90
91
  });
91
92
  </script>
92
93
  ```
@@ -204,5 +205,5 @@ Kaitai Struct compiler in JavaScript depends on the following libraries:
204
205
 
205
206
  Note that these clauses only apply only to compiler itself, not `.ksy`
206
207
  input files that one supplies in normal process of compilation, nor to
207
- compiler's output files — that consitutes normal usage process and you
208
+ compiler's output files — that constitutes normal usage process and you
208
209
  obviously keep copyright to both.