MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / convertStream

Function convertStream

node/cli.js:203–211  ·  view source on GitHub ↗
(converter, options, callback)

Source from the content-addressed store, hash-verified

201}
202
203function convertStream(converter, options, callback) {
204 if (isSameFile(options.input, options.output)) {
205 throw new Error('Input and output refer to the same file.');
206 }
207
208 const input = options.input ? fs.createReadStream(options.input) : process.stdin;
209 const output = options.output ? fs.createWriteStream(options.output) : process.stdout;
210 pipeline(input, createConverterStream(converter), output, callback);
211}
212
213function main() {
214 let options;

Callers 1

mainFunction · 0.85

Calls 2

isSameFileFunction · 0.85
createConverterStreamFunction · 0.85

Tested by

no test coverage detected