This adds to Dax what's available in Bun's shell where instead of providing objects to the entire command like so:
const request = $.request("https://plugins.dprint.dev/info.json")
.showProgress();
const bytes = await `gzip`.stdin(request).bytes(); // obviously, gzip doesn't work on windows
You can now do:
const request = $.request("https://plugins.dprint.dev/info.json")
.showProgress();
const bytes = await `gzip < ${request}`.bytes();
// makes the request after 5 seconds instead of immediately
// (not possible without two separate statements before)
const bytes2 = await `sleep 5 && gzip < ${request}`.bytes();
FsFileWrapper (dax's wrapper over Deno's FsFile in the $.path API)
Function - Must return a ReadableStream<Uint8Array> or WritableStream
Additionally, the $.symbols.writable (Symbol.for("dax.writableStream")) and $.symbols.readable (Symbol.for("dax.readableStream")) symbols can be attached to any object to make them work in these positions (still debating this).
Unsupported objects in this position will cause an error:
This adds to Dax what's available in Bun's shell where instead of providing objects to the entire command like so:
You can now do:
You can also now redirect into any
WritableStream
:Or do an input redirect from any
ReadableStream
:Or provide bytes:
Or
Response
objects:Other supported objects:
FsFileWrapper
(dax's wrapper over Deno'sFsFile
in the$.path
API)Function
- Must return aReadableStream<Uint8Array>
orWritableStream
Additionally, the
$.symbols.writable
(Symbol.for("dax.writableStream")
) and$.symbols.readable
(Symbol.for("dax.readableStream")
) symbols can be attached to any object to make them work in these positions (still debating this).Unsupported objects in this position will cause an error: