matthewmueller / matthewmueller/loo

Not working with custom stream

Open
#11 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
15
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Currently it is impossible to pass a Wrtiable as part of the pipe command:

var loolog = require('loo')('test')
var dest = require('fs').createWriteStream('myfile')
loolog.pipe(dest)

Results in

Error: Cannot pipe, not readable
    at WriteStream.Writable.pipe (_stream_writable.js:161:22)
    at Function.pipe (/Users/matteo/Repositories/pino/node_modules/loo/index.js:144:14)

It is highly related to: https://github.com/matthewmueller/loo/blob/master/index.js#L141-L144

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect index.js around lines 141-144, then reproduce the issue with fs.createWriteStream and the documented pipe call. Done means a writable custom stream can be passed to pipe without the “Cannot pipe, not readable” error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.