import { Reader } from '../reader' ; import { Writer } from '../writer' ; import * as streams from '../node-wrappers' ; export const input = function ( encoding ? ) { const st = new streams . ReadableStream ( process . stdin , { } ) ; st . setEncoding ( encoding || null ) ; process . stdin . resume ( ) ; return st . reader ; } ; export const output = function ( encoding ? ) { return new streams . WritableStream ( process . stdout , { encoding : encoding , } ) . writer ; } ; export const error = function ( encoding ? ) { return new streams . WritableStream ( process . stderr , { encoding : encoding , } ) . writer ; } ; export interface Input { ( encoding ) : Reader < string > ; ( ) : Reader < Buffer > ; } export interface Output { ( encoding ) : Writer < string > ; ( ) : Writer < Buffer > ; } exports . in = input ; exports . out = output ; exports . err = error ;