Skip to content

Instantly share code, notes, and snippets.

@vjrantal
Last active August 29, 2017 05:23
Show Gist options
  • Save vjrantal/28b7521a4b22644c357145b7070c9986 to your computer and use it in GitHub Desktop.
Save vjrantal/28b7521a4b22644c357145b7070c9986 to your computer and use it in GitHub Desktop.
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