@@ -351,33 +351,34 @@ notes.
351
351
# CLI
352
352
353
353
```
354
- Usage: dzx [script] [args...]
355
- Version: 0.3.0
356
-
357
- Description:
358
-
359
- 🦕 A custom deno runtime for fun.
360
-
361
- Options:
362
-
363
- -h, --help - Show this help.
364
- -V, --version - Show the version number for this program.
365
- -A, --allow-all - Allow all permissions. (Depends: --worker)
366
- --allow-env - Allow environment access. (Depends: --worker)
367
- --allow-hrtime - Allow high resolution time measurement. (Depends: --worker)
368
- --allow-net - Allow network access. (Depends: --worker)
369
- --allow-ffi - Allow loading dynamic libraries. (Depends: --worker)
370
- --allow-read - Allow file system read access. (Depends: --worker)
371
- --allow-run - Allow running subprocesses. (Depends: --worker)
372
- --allow-write - Allow file system write access. (Depends: --worker)
373
- -w, --worker - Run script in an isolated web worker with it's own permissions.
374
-
375
- Commands:
376
-
377
- bundle [script] - Bundle an dzx script to a standalone deno sript.
378
- compile [compile-options...] [script] [script-options...] - Combile an dzx script to a standalone binary.
379
- repl - Start a dzx repl
380
- upgrade - Upgrade dzx executable to latest or given version.
354
+ Usage: dzx [script] [args...]
355
+ Version: 0.3.0
356
+
357
+ Description:
358
+
359
+ 🦕 A custom deno runtime for fun.
360
+
361
+ Options:
362
+
363
+ -h, --help - Show this help.
364
+ -V, --version - Show the version number for this program.
365
+ -A, --allow-all - Allow all permissions. (Depends: --worker)
366
+ --allow-env - Allow environment access. (Depends: --worker)
367
+ --allow-hrtime - Allow high resolution time measurement. (Depends: --worker)
368
+ --allow-net - Allow network access. (Depends: --worker)
369
+ --allow-ffi - Allow loading dynamic libraries. (Depends: --worker)
370
+ --allow-read - Allow file system read access. (Depends: --worker)
371
+ --allow-run - Allow running subprocesses. (Depends: --worker)
372
+ --allow-write - Allow file system write access. (Depends: --worker)
373
+ -w, --worker - Run script in an isolated web worker with it's own permissions.
374
+
375
+ Commands:
376
+
377
+ bundle [script] - Bundle an dzx script to a standalone deno sript.
378
+ compile [compile-options...] [script] [script-options...] - Combile an dzx script to a standalone binary.
379
+ eval <code> - Evaluate a dzx script from the command line.
380
+ repl - Start a dzx repl.
381
+ upgrade - Upgrade dzx executable to latest or given version.
381
382
```
382
383
383
384
- ** dzx** ` [script] [...args] ` : Run a local or remote dzx script (optional in a
@@ -412,9 +413,41 @@ notes.
412
413
> flag with your permissions to specify the output file name, otherwise the
413
414
> compiled file will be emitted with a random value as its name.
414
415
415
- - ** dzx repl** : Start a dzx repl (deno repl bootstrapped with dzx).
416
+ - ** dzx eval** : Evaluate a dzx script from command line.
417
+
418
+ ` ` ` shell
419
+ dzx eval " console.log($.shell)"
420
+ ```
421
+
422
+ Eval can also read from stdin:
423
+
424
+ ``` shell
425
+ echo " console.log($.shell)" | dzx eval
426
+ ```
427
+
428
+ - ** dzx repl** : Start a dzx repl (Read eval print loop).
416
429
417
- - ** dzx upgrade** : Start a dzx repl.
430
+ The ` repl ` command starts a deno repl bootstrapped with the dzx runtime code.
431
+
432
+ - ** dzx upgrade** : Upgrade the ` dzx ` executable to latest or given version.
433
+
434
+ Upgrade to latest version:
435
+
436
+ ``` shell
437
+ dzx upgrade
438
+ ```
439
+
440
+ Upgrade to specific version:
441
+
442
+ ``` shell
443
+ dzx upgrade --version 3.0.0
444
+ ```
445
+
446
+ List all available versions:
447
+
448
+ ``` shell
449
+ dzx upgrade --list-versions
450
+ ```
418
451
419
452
## Contributing
420
453
0 commit comments