Skip to content

Instantly share code, notes, and snippets.

@vjrantal
Last active Aug 29, 2017
Embed
What would you like to do?
Streaming Node.js function
{
"bindings": [
{
"type": "blobTrigger",
"name": "input",
"direction": "in",
"dataType": "stream",
"path": "test-input-node/{name}"
},
{
"type": "blob",
"name": "output",
"direction": "out",
"dataType": "stream",
"path": "test-output-node/{name}"
}
]
}
const zlib = require('zlib');
module.exports = function (context, input) {
input
.pipe(zlib.createGzip())
.pipe(context.bindings.output)
.on('finish', context.done);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment