Hello,
It would be nice to add the following features to cross-runtime :
- Tauri support :
- A
readLines method for reading a file line by line :
- An
exec method for running a command and returning an output :
- A
spawn method for running a command and returning a stream :
- A
writeBinaryFile method for writing binary files :
- A
readBinaryFile method for reading binary files :
Additionally, it would be nice to :
- have
writeTextFile & readTextFile aliases for writeFile & readFile for consistency purposes ;
- use
Bun.file().text() in readFile instead of relying on Bun's Node polyfill.
If you'd like, I'm willing to make a PR for everything listed here, with JS and JSDoc, but not TS though.
Thanks
Hello,
It would be nice to add the following features to
cross-runtime:isTauriusingwindow.__TAURI__;writeFileusingwriteTextFilefrom@tauri-apps/api/fs;readFileusingreadTextFilefrom@tauri-apps/api/fs.readLinesmethod for reading a file line by line :createInterfacefromnode:readline&createReadStreamfromnode:fs;execmethod for running a command and returning an output :Deno.Command().output();execfromnode:child_process;$``.quiet()frombun;new Command().execute()from@tauri-apps/api/shell.spawnmethod for running a command and returning a stream :Deno.Command().spawn();spawnfromnode:child_process;Bun.spawn();new Command().spawn()from@tauri-apps/api/shell.writeBinaryFilemethod for writing binary files :Deno.writeFile()taking anUint8Array;encoding=nulltaking aBufferor anyTypedArray;Bun.write()taking anArrayBuffer, aBlobor anyTypedArray;writeBinaryFilefrom@tauri-apps/api/fstaking anArrayBuffer;readBinaryFilemethod for reading binary files :Deno.readFile()returning anUint8Array;encoding=nullreturning aBuffer;Bun.file().arrayBuffer()returning anArrayBuffer;readBinaryFilefrom@tauri-apps/api/fsreturning anUint8Array;ArrayBufferby default.Additionally, it would be nice to :
writeTextFile&readTextFilealiases forwriteFile&readFilefor consistency purposes ;Bun.file().text()inreadFileinstead of relying on Bun's Node polyfill.If you'd like, I'm willing to make a PR for everything listed here, with JS and JSDoc, but not TS though.
Thanks