3h-join

A stream body parser.

Usage no npm install needed!

<script type="module">
  import hJoin from 'https://cdn.skypack.dev/3h-join';
</script>

README

3h-join

A stream body parser.

Example

const join = require('3h-join');

function callback(err, data) {
    if (err) {
        console.error('Error while reading stream: ', err);
    } else {
        console.log(`Received: ${JSON.stringify(data)}`);
    }
}

join.text({ stream: textStream }, callback);

join.json({
    stream: jsonStream,
    // parser: myJSONParser
}, callback);

join.form({
    stream: formStream,
    // parser: myFormParser
}, callback);

APIs

See the declaration file to learn the APIs.