Construct-JS – A library for creating byte level data structures
What's the point of such a "declarative" API?<p><pre><code>  const localHeader = Struct('localHeader')
    .field('header', DoubleWord(0x04034b50))
    .field('sharedHeaderInfo', sharedHeaderInfo)
    .field('filename', filename);
</code></pre>
There's already a construct for key-value pairs in JS, it's called <i>an object</i>:<p><pre><code>  const localHeader = Struct('localHeader', {
    'header': DoubleWord(0x04034b50),
    'sharedHeaderInfo': sharedHeaderInfo,
    'filename': filename
  });</code></pre>