Structured Header parser for Javascript
This library is a parser for the structured header specification. Currently it's still a draft, so this package is also in alpha until the specification stabilizes as a RFC.
Installation
Using npm:
npm install structured-header
Using Yarn:
yarn add structured-header
API
The library exposes 3 functions, and they're used as such:
var header = ; header;// Returns { foo: 1.23, en: 'Applepie', da: new Buffer('...') }; header;// Returns ['foo', 'bar', 'baz_45']; header; // Returns [// [ 'abc_123', { a: 1, b: 2, c: null } ],// [ 'def_456', {} ],// [ 'ghi', { q: '19', r: 'foo' } ]// ]
Browser support
There is a minified version of this library in the dist/
directory. This minified
file will expose a global variable called 'structuredHeader' which contains the rest
of the api.