untitled notebook

node v13.14.0
version: master
endpointsharetweet
const http = require('http'); const {pipeline, PassThrough} = require('stream'); http.get('http://example.com', response => { const stream = new PassThrough(); response.on('error', error => { console.log('response error', error); }); stream.on('error', error => { console.log('stream error', error); }); pipeline( response, stream, error => { console.log('pipeline error', error); } ); stream.destroy(new Error('oh no')); }).on('error', error => { console.log('request error', error); }); '';
Loading…

no comments

    sign in to comment