Giter Club home page Giter Club logo

tailing-stream's People

Contributors

deusexlibris avatar jasontbradshaw avatar trshafer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tailing-stream's Issues

Doesn't return a fs.createReadStream similar thing. Error: Cannot read property 'on' of undefined

I'm receiving a stream via socket.io.-stream then saving it. I need this module to read the the file which is continuously growing and then push to box.com. Your readme didn't include any example. Can you please show me how this can be done?

io.on('connection', socket => {
console.log('connection');

ss(socket).on('file', (stream, data) => {
    console.log('>>>Received File Emit at <<<', new Date().toString());
    console.log('data.originalName', data.originalName);

    var streamFileName = './uploads/'+data.originalName;

    stream.pipe(fs.createWriteStream( streamFileName ));
    
     var boxStream = ts.TailingReadableStream (path.join(__dirname, streamFileName),{timeout: 5000});

   function requestCallback(err, res, body) {
        console.log('Request body: ',body);
    }

      var total = 0;
      boxStream.on('data', (chunk) => {

        total += chunk.length;
        var progress = (1.0 * total) / data.size;
        console.log('Box upload progres : ', progress);
      });

      var accessToken = 'hidden';
      var parent_folder_id = 'hidden';

      var r = request.post({
          url: 'https://upload.box.com/api/2.0/files/content',
          headers: { 'Authorization': 'Bearer ' + accessToken }
          }, requestCallback);

      var form = r.form();

      form.append('parent_id', parent_folder_id);
      form.append("file", boxStream);        

});

});

Unimplemented _read() method error

I'm trying to use this module with a pipe but it throws an error about an unimplemented method:

Error [ERR_METHOD_NOT_IMPLEMENTED]: The _read() method is not implemented
    at TailingReadableStream.Readable._read (_stream_readable.js:611:24)
    at TailingReadableStream.Readable.read (_stream_readable.js:457:10)
    at flow (_stream_readable.js:957:34)
    at Mp4Frag.pipeOnDrainFunctionResult (_stream_readable.js:761:7)
    at Mp4Frag.emit (events.js:198:13)
    at onwriteDrain (_stream_writable.js:495:12)
    at afterWrite (_stream_writable.js:483:5)
    at process._tickCallback (internal/process/next_tick.js:63:19

I see from the state of other tickets that this module is unmaintained, but at least this ticket will help others finding that the module is no longer compatible with the ReadableStream API to understand that they will need to find another module or write their own solution.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.