ivanseidel / ivanseidel/node-draftlog
Proposals for new version
- Lingua principale
- JavaScript
- Stelle
- 1.2k
- Fork
- 33
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
`DraftLog` works. The API is simple. I want to keep it that way, but it might be improved with a few ideas.
Please, contribute by giving your insights, ideas and so on.
### `[1]` Avoid overriding `console._stdout`
Can we find a way to NOT put something in the middle of the Stream? Is it possible to 'listen' to data on a Writable stream? If so, that's all we need (we don't ever modify contents anyway)
### `[2]` Should we 'hook' draft method into `console`?
Hooking into console is really cool, but... To specific.
What if the person doesn't uses `console` to do logging, but writing to `stdout` directly?
In that case, it would cause two problems:
1. Draft method would be available only through custom instantiated `Console`. That's a bad requirement to ask developers... (Console is cool, but not a requirement for logging stuff)
2. If any data get's logged directly into `stdout`, then it would not capture that data. `[1]` would fix that, if just in listening mode.
### `[3]` Ideas for a new (and simpler) API
```javascript
const DraftLog = require('draftlog')
console.draft = DraftLog(process.stdout[, process.stdin])
// Or save to a custom function maybe
const draft = DraftLog(process.stdout[, process.stdin])
// Would make things easier in case of disabling:
if (PRODUCTION)
const draft = DraftLog();
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
L’issue non indica file né test; inizia esaminando l’API attuale di DraftLog e la sua gestione degli stream console e stdout. Confronta le opzioni proposte per l’ascolto degli stream e per l’API, quindi chiarisci quale design debba essere implementato. L’attività è completata quando esiste una proposta concordata con un comportamento definito per console, il logging diretto su stdout e la disabilitazione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, node.js
- Ambito
- cli
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 20/100