jkcfg / jk

Configuration as Code with ECMAScript
https://jkcfg.github.io
Apache License 2.0
404 stars 30 forks source link

Use const symbols for stdin and stdout #339

Closed squaremo closed 4 years ago

squaremo commented 4 years ago

Up to now, passing '' has meant stdin (for read) and stdout (for write), but this is not very guessable.

Instead, use a symbol for each of stdin and stdout. The combo-keyword unique symbol in TypeScript means that typeof stdin will accept only that symbol (in contrast with the type symbol).

This, along with changes to the docs in the website, should help with #161.