-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port to Deno :) #24
Comments
@ry why not use Deno in first place? 😋 |
@ry this is definitely a good idea. Will take a look at how to do it. |
Here is a working Deno version if you're interested https://deno.land/x/zx_deno. All features but deno install -A --unstable https://deno.land/x/zx_deno/mod.mjs |
I was just thinking of this, Minigugus beat me to it. Deno would also make it really simple to distribute a simple binary that already has all the zx shortcuts pre-bundled, and distribute it to package managers if it gains enough traction. @Minigugus what unstable features is your fork using? |
@josh-hemphill My fork use https://deno.land/[email protected]/node/os.ts and https://deno.land/[email protected]/node/fs.ts in order to preserve scripts compatibility with the original And indeed, Deno is fine here, for instance it can run remote code natively, it have a native It is even possible to run a remote EDIT: It is now available on |
Cool! I wonder if it possible to use compatibility later to make zx able to run on nodejs and deno simultaneously. |
@antonmedv Thanks to the |
Fair point, so it’s better to have two separate implementation for different backends. |
@antonmedv Another solution could be to enhance the api exposed by |
found this one too: https://github.com/linux-china/dx |
After thinking 💭 zx targets only node. And there’s already a few deno implementations. Edit: now zx support both deno and bun 😄 |
Adding some info here. While a direct Deno port is not available, zx is working fine through Deno's Node compat layer:
Gotchas:
|
This why I don’t think supporting both runtimes is something I want to do) |
Currently, it seems to the zx works with Deno thanks to AsyncLocalStorage becoming ready on Deno. import "npm:[email protected]/globals";
await $`echo "Hello, world!"`; ❯ deno --version
deno 1.30.3 (release, x86_64-unknown-linux-gnu)
v8 10.9.194.5
typescript 4.9.4
❯ deno run -A hello.ts
$ echo "Hello, world!"
Hello, world! |
Wow! Supper impressive) |
No description provided.
The text was updated successfully, but these errors were encountered: